|
clang 22.0.0git
|
#include "CodeGenFunction.h"#include "CGBlocks.h"#include "CGCUDARuntime.h"#include "CGCXXABI.h"#include "CGCleanup.h"#include "CGDebugInfo.h"#include "CGHLSLRuntime.h"#include "CGOpenMPRuntime.h"#include "CodeGenModule.h"#include "CodeGenPGO.h"#include "TargetInfo.h"#include "clang/AST/ASTContext.h"#include "clang/AST/ASTLambda.h"#include "clang/AST/Attr.h"#include "clang/AST/Decl.h"#include "clang/AST/DeclCXX.h"#include "clang/AST/Expr.h"#include "clang/AST/StmtCXX.h"#include "clang/AST/StmtObjC.h"#include "clang/Basic/Builtins.h"#include "clang/Basic/CodeGenOptions.h"#include "clang/Basic/TargetBuiltins.h"#include "clang/Basic/TargetInfo.h"#include "clang/CodeGen/CGFunctionInfo.h"#include "clang/Frontend/FrontendDiagnostic.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/ADT/ScopeExit.h"#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/FPEnv.h"#include "llvm/IR/Instruction.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Intrinsics.h"#include "llvm/IR/MDBuilder.h"#include "llvm/Support/CRC.h"#include "llvm/Support/xxhash.h"#include "llvm/Transforms/Scalar/LowerExpectIntrinsic.h"#include "llvm/Transforms/Utils/PromoteMemToReg.h"#include <optional>#include "clang/AST/TypeNodes.inc"#include "clang/Basic/Sanitizers.def"Go to the source code of this file.
Namespaces | |
| namespace | llvm |
| Diagnostic wrappers for TextAPI types for error reporting. | |
Macros | |
| #define | TYPE(name, parent) |
| #define | ABSTRACT_TYPE(name, parent) |
| #define | NON_CANONICAL_TYPE(name, parent) |
| #define | DEPENDENT_TYPE(name, parent) |
| #define | NON_CANONICAL_UNLESS_DEPENDENT_TYPE(name, parent) |
| #define | SANITIZER(NAME, ID) |
| #define | TYPE(Class, Base) |
| #define | ABSTRACT_TYPE(Class, Base) |
| #define | NON_CANONICAL_TYPE(Class, Base) |
| #define | DEPENDENT_TYPE(Class, Base) |
| #define | NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base) |
Functions | |
| static bool | shouldEmitLifetimeMarkers (const CodeGenOptions &CGOpts, const LangOptions &LangOpts) |
| shouldEmitLifetimeMarkers - Decide whether we need emit the life-time markers. | |
| static LValue | makeNaturalAlignAddrLValue (llvm::Value *V, QualType T, bool ForPointeeType, bool MightBeSigned, CodeGenFunction &CGF, KnownNonNull_t IsKnownNonNull=NotKnownNonNull) |
| static void | EmitIfUsed (CodeGenFunction &CGF, llvm::BasicBlock *BB) |
| static bool | endsWithReturn (const Decl *F) |
| Determine whether the function F ends with a return stmt. | |
| static bool | matchesStlAllocatorFn (const Decl *D, const ASTContext &Ctx) |
| static llvm::Constant * | getPrologueSignature (CodeGenModule &CGM, const FunctionDecl *FD) |
Return the UBSan prologue signature for FD if one is available. | |
| static void | TryMarkNoThrow (llvm::Function *F) |
| Tries to mark the given function nounwind based on the non-existence of any throwing calls within it. | |
| static void | emitNonZeroVLAInit (CodeGenFunction &CGF, QualType baseType, Address dest, Address src, llvm::Value *sizeInChars) |
| emitNonZeroVLAInit - Emit the "zero" initialization of a variable-length array whose elements have a non-zero bit-pattern. | |
| static void | CreateMultiVersionResolverReturn (CodeGenModule &CGM, llvm::Function *Resolver, CGBuilderTy &Builder, llvm::Function *FuncToReturn, bool SupportsIFunc) |
| static llvm::Value * | EmitPointerAuthCommon (CodeGenFunction &CGF, const CGPointerAuthInfo &PointerAuth, llvm::Value *Pointer, unsigned IntrinsicID) |
| static llvm::Value * | EmitStrip (CodeGenFunction &CGF, const CGPointerAuthInfo &PointerAuth, llvm::Value *Pointer) |
| #define ABSTRACT_TYPE | ( | Class, | |
| Base ) |
| #define ABSTRACT_TYPE | ( | name, | |
| parent ) |
| #define DEPENDENT_TYPE | ( | Class, | |
| Base ) |
| #define DEPENDENT_TYPE | ( | name, | |
| parent ) |
| #define NON_CANONICAL_TYPE | ( | Class, | |
| Base ) |
| #define NON_CANONICAL_TYPE | ( | name, | |
| parent ) |
| #define NON_CANONICAL_UNLESS_DEPENDENT_TYPE | ( | Class, | |
| Base ) |
| #define NON_CANONICAL_UNLESS_DEPENDENT_TYPE | ( | name, | |
| parent ) |
| #define SANITIZER | ( | NAME, | |
| ID ) |
| #define TYPE | ( | Class, | |
| Base ) |
| #define TYPE | ( | name, | |
| parent ) |
|
static |
|
static |
Definition at line 354 of file CodeGenFunction.cpp.
References clang::CodeGen::CodeGenFunction::CurFn.
Referenced by clang::CodeGen::CodeGenFunction::FinishFunction().
|
static |
emitNonZeroVLAInit - Emit the "zero" initialization of a variable-length array whose elements have a non-zero bit-pattern.
| baseType | the inner-most element type of the array |
| src | - a char* pointing to the bit-pattern for a single base element of the array |
| sizeInChars | - the total size of the VLA, in chars |
Definition at line 2174 of file CodeGenFunction.cpp.
References clang::CharUnits::alignmentOfArrayElement(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::Address::emitRawPointer(), clang::CodeGen::Address::getAlignment(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::Address::getElementType(), clang::CharUnits::getQuantity(), clang::CodeGen::Address::getType(), clang::ASTContext::getTypeSizeInChars(), clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::CodeGen::CodeGenTypeCache::IntPtrTy, and clang::CodeGen::Address::withElementType().
Referenced by clang::CodeGen::CodeGenFunction::EmitNullInitialization().
|
static |
Definition at line 3304 of file CodeGenFunction.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CGPointerAuthInfo::getDiscriminator(), clang::CodeGen::CodeGenModule::getIntrinsic(), clang::CodeGen::CGPointerAuthInfo::getKey(), clang::CodeGen::CGBuilderTy::getSize(), clang::CodeGen::CodeGenTypeCache::IntPtrTy, and Pointer.
Referenced by clang::CodeGen::CodeGenFunction::EmitPointerAuthAuth(), and clang::CodeGen::CodeGenFunction::EmitPointerAuthSign().
|
static |
Definition at line 3340 of file CodeGenFunction.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitRuntimeCall(), clang::CodeGen::CodeGenModule::getIntrinsic(), clang::CodeGen::CGPointerAuthInfo::getKey(), clang::CodeGen::CodeGenTypeCache::IntPtrTy, and Pointer.
Referenced by clang::CodeGen::CodeGenFunction::EmitPointerAuthAuth().
Determine whether the function F ends with a return stmt.
Definition at line 682 of file CodeGenFunction.cpp.
References clang::FunctionDecl::getBody(), and clang::isa().
Referenced by clang::CodeGen::CodeGenFunction::StartFunction().
|
static |
Return the UBSan prologue signature for FD if one is available.
Definition at line 745 of file CodeGenFunction.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenModule::getTargetCodeGenInfo(), clang::CodeGen::TargetCodeGenInfo::getUBSanFunctionSignature(), and clang::CXXMethodDecl::isStatic().
Referenced by clang::CodeGen::CodeGenFunction::StartFunction().
|
static |
Definition at line 195 of file CodeGenFunction.cpp.
References clang::Addr, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CodeGenModule::getNaturalTypeAlignment(), clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::CodeGen::CodeGenFunction::makeNaturalAddressForPointer(), clang::CodeGen::NotKnownNonNull, clang::T, and V.
|
static |
Definition at line 711 of file CodeGenFunction.cpp.
References clang::ASTContext::getSizeType(), and clang::ASTContext::hasSameType().
Referenced by clang::CodeGen::CodeGenFunction::StartFunction().
|
static |
shouldEmitLifetimeMarkers - Decide whether we need emit the life-time markers.
Definition at line 63 of file CodeGenFunction.cpp.
References clang::SanitizerSet::has(), and clang::LangOptions::Sanitize.
Referenced by clang::CodeGen::CodeGenFunction::CodeGenFunction().
|
static |
Tries to mark the given function nounwind based on the non-existence of any throwing calls within it.
We believe this is lightweight enough to do at -O0.
Definition at line 1406 of file CodeGenFunction.cpp.
Referenced by clang::CodeGen::CodeGenFunction::GenerateCode().