|
clang 24.0.0git
|
This class gathers all debug information during compilation and is responsible for emitting to llvm globals or pass directly to the backend. More...
#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CodeGen/CGDebugInfo.h"
Public Member Functions | |
| CGDebugInfo (CodeGenModule &CGM) | |
| ~CGDebugInfo () | |
| void | finalize () |
| std::string | remapDIPath (StringRef) const |
| Remap a given path with the current debug prefix map. | |
| void | registerVLASizeExpression (QualType Ty, llvm::Metadata *SizeExpr) |
| Register VLA size expression debug node with the qualified type. | |
| void | setLocation (SourceLocation Loc) |
| Update the current source location. | |
| SourceLocation | getLocation () const |
| Return the current source location. | |
| void | setInlinedAt (llvm::DILocation *InlinedAt) |
| Update the current inline scope. | |
| llvm::DILocation * | getInlinedAt () const |
| llvm::DebugLoc | SourceLocToDebugLoc (SourceLocation Loc) |
| void | EmitLocation (CGBuilderTy &Builder, SourceLocation Loc) |
| Emit metadata to indicate a change in line/column information in the source file. | |
| QualType | getFunctionType (const FunctionDecl *FD, QualType RetTy, const SmallVectorImpl< const VarDecl * > &Args) |
| void | emitFunctionStart (GlobalDecl GD, SourceLocation Loc, SourceLocation ScopeLoc, QualType FnType, llvm::Function *Fn, bool CurFnIsThunk) |
| Emit a call to llvm.dbg.function.start to indicate start of a new function. | |
| void | EmitInlineFunctionStart (CGBuilderTy &Builder, GlobalDecl GD) |
| Start a new scope for an inlined function. | |
| void | EmitInlineFunctionEnd (CGBuilderTy &Builder) |
| End an inlined function scope. | |
| void | EmitFunctionDecl (GlobalDecl GD, SourceLocation Loc, QualType FnType, llvm::Function *Fn=nullptr) |
| Emit debug info for a function declaration. | |
| void | EmitFuncDeclForCallSite (llvm::CallBase *CallOrInvoke, QualType CalleeType, GlobalDecl CalleeGlobalDecl) |
| Emit debug info for an extern function being called. | |
| void | EmitFunctionEnd (CGBuilderTy &Builder, llvm::Function *Fn) |
| Constructs the debug code for exiting a function. | |
| void | EmitLexicalBlockStart (CGBuilderTy &Builder, SourceLocation Loc) |
| Emit metadata to indicate the beginning of a new lexical block and push the block onto the stack. | |
| void | EmitLexicalBlockEnd (CGBuilderTy &Builder, SourceLocation Loc) |
| Emit metadata to indicate the end of a new lexical block and pop the current block. | |
| llvm::DILocalVariable * | EmitDeclareOfAutoVariable (const VarDecl *Decl, llvm::Value *AI, CGBuilderTy &Builder, const bool UsePointerValue=false) |
Emit call to llvm.dbg.declare for an automatic variable declaration. | |
| void | EmitLabel (const LabelDecl *D, CGBuilderTy &Builder) |
Emit call to llvm.dbg.label for an label. | |
| void | EmitDeclareOfBlockDeclRefVariable (const VarDecl *variable, llvm::Value *storage, CGBuilderTy &Builder, const CGBlockInfo &blockInfo, llvm::Instruction *InsertPoint=nullptr) |
Emit call to llvm.dbg.declare for an imported variable declaration in a block. | |
| llvm::DILocalVariable * | EmitDeclareOfArgVariable (const VarDecl *Decl, llvm::Value *AI, unsigned ArgNo, CGBuilderTy &Builder, bool UsePointerValue=false) |
Emit call to llvm.dbg.declare for an argument variable declaration. | |
| void | EmitDeclareOfBlockLiteralArgVariable (const CGBlockInfo &block, StringRef Name, unsigned ArgNo, llvm::AllocaInst *LocalAddr, CGBuilderTy &Builder) |
Emit call to llvm.dbg.declare for the block-literal argument to a block invocation function. | |
| void | EmitGlobalVariable (llvm::GlobalVariable *GV, const VarDecl *Decl) |
| Emit information about a global variable. | |
| void | EmitGlobalVariable (const ValueDecl *VD, const APValue &Init) |
| Emit a constant global variable's debug info. | |
| void | EmitExternalVariable (llvm::GlobalVariable *GV, const VarDecl *Decl) |
| Emit information about an external variable. | |
| void | EmitPseudoVariable (CGBuilderTy &Builder, llvm::Instruction *Value, QualType Ty) |
| Emit a pseudo variable and debug info for an intermediate value if it does not correspond to a variable in the source code, so that a profiler can track more accurate usage of certain instructions of interest. | |
| void | EmitGlobalAlias (const llvm::GlobalValue *GV, const GlobalDecl Decl) |
| Emit information about global variable alias. | |
| llvm::DenseMap< const llvm::DIFile *, OptionalFileEntryRef > | getDIFileSources () const |
| Return the source file each DIFile was created for, or std::nullopt for a DIFile shared by several files. | |
| void | EmitUsingDirective (const UsingDirectiveDecl &UD) |
| Emit C++ using directive. | |
| void | EmitExplicitCastType (QualType Ty) |
| Emit the type explicitly casted to. | |
| void | EmitAndRetainType (QualType Ty) |
| Emit the type even if it might not be used. | |
| void | EmitUsingShadowDecl (const UsingShadowDecl &USD) |
| Emit a shadow decl brought in by a using or using-enum. | |
| void | EmitUsingDecl (const UsingDecl &UD) |
| Emit C++ using declaration. | |
| void | EmitUsingEnumDecl (const UsingEnumDecl &UD) |
| Emit C++ using-enum declaration. | |
| void | EmitImportDecl (const ImportDecl &ID) |
| Emit an @import declaration. | |
| void | AddStringLiteralDebugInfo (llvm::GlobalVariable *GV, const StringLiteral *S) |
| DebugInfo isn't attached to string literals by default. | |
| llvm::DIImportedEntity * | EmitNamespaceAlias (const NamespaceAliasDecl &NA) |
| Emit C++ namespace alias. | |
| std::pair< llvm::DIType *, unsigned > | getOrCreatePreserveAccessInfo (QualType Ty, const FieldDecl *Field) |
| Return the complete record type and field index for preserve-access intrinsics. | |
| llvm::DIType * | getOrCreateInterfaceType (QualType Ty, SourceLocation Loc) |
| Emit an Objective-C interface type standalone debug info. | |
| void | recordDeclarationLexicalScope (const Decl &D) |
| Map AST declaration to its lexical block scope if available. | |
| llvm::DIScope * | getDeclarationLexicalScope (const Decl *D) |
| Get lexical scope of AST declaration. | |
| llvm::DIType * | getOrCreateStandaloneType (QualType Ty, SourceLocation Loc) |
| Emit standalone debug info for a type. | |
| void | addHeapAllocSiteMetadata (llvm::CallBase *CallSite, QualType AllocatedTy, SourceLocation Loc) |
| Add heapallocsite metadata for MSAllocator calls. | |
| void | completeType (const EnumDecl *ED) |
| void | completeType (const RecordDecl *RD) |
| void | completeRequiredType (const RecordDecl *RD) |
| void | completeClassData (const RecordDecl *RD) |
| void | completeClass (const RecordDecl *RD) |
| void | completeTemplateDefinition (const ClassTemplateSpecializationDecl &SD) |
| void | completeUnusedClass (const CXXRecordDecl &D) |
| llvm::DIMacro * | CreateMacro (llvm::DIMacroFile *Parent, unsigned MType, SourceLocation LineLoc, StringRef Name, StringRef Value) |
| Create debug info for a macro defined by a #define directive or a macro undefined by a #undef directive. | |
| llvm::DIMacroFile * | CreateTempMacroFile (llvm::DIMacroFile *Parent, SourceLocation LineLoc, SourceLocation FileLoc) |
| Create debug info for a file referenced by an #include directive. | |
| Param2DILocTy & | getParamDbgMappings () |
| ParamDecl2StmtTy & | getCoroutineParameterMappings () |
| llvm::DILocation * | CreateTrapFailureMessageFor (llvm::DebugLoc TrapLocation, StringRef Category, StringRef FailureMsg) |
| Create a debug location from TrapLocation that adds an artificial inline frame where the frame name is. | |
| llvm::DILocation * | CreateSyntheticInlineAt (llvm::DebugLoc ParentLocation, llvm::DISubprogram *SynthSubprogram) |
| Create a debug location from Location that adds an artificial inline frame where the frame name is FuncName. | |
| llvm::DILocation * | CreateSyntheticInlineAt (llvm::DebugLoc ParentLocation, StringRef SynthFuncName, llvm::DIFile *SynthFile) |
| void | completeFunction () |
| Reset internal state. | |
| void | addInstToCurrentSourceAtom (llvm::Instruction *KeyInstruction, llvm::Value *Backup) |
Add KeyInstruction and an optional Backup instruction to the current atom group, created using ApplyAtomGroup. | |
| void | addInstToSpecificSourceAtom (llvm::Instruction *KeyInstruction, llvm::Value *Backup, uint64_t Atom) |
Add KeyInstruction and an optional Backup instruction to the atom group Atom. | |
| void | emitVTableSymbol (llvm::GlobalVariable *VTable, const CXXRecordDecl *RD) |
| Emit symbol for debugger that holds the pointer to the vtable. | |
| llvm::DINode::DIFlags | getCallSiteRelatedAttrs () const |
| Return flags which enable debug info emission for call sites, provided that it is supported and enabled. | |
| void | addCallTargetIfVirtual (const FunctionDecl *FD, llvm::CallBase *CI) |
| Add call target information. | |
| void | setDwoId (uint64_t Signature) |
| Module debugging: Support for building PCMs. | |
| void | setModuleMap (ModuleMap &MMap) |
| When generating debug information for a clang module or precompiled header, this module map will be used to determine the module of origin of each Decl. | |
| void | setPCHDescriptor (ASTSourceDescriptor PCH) |
| When generating debug information for a clang module or precompiled header, this module map will be used to determine the module of origin of each Decl. | |
Friends | |
| class | ApplyDebugLocation |
| class | ApplyAtomGroup |
This class gathers all debug information during compilation and is responsible for emitting to llvm globals or pass directly to the backend.
Definition at line 60 of file CGDebugInfo.h.
| CGDebugInfo::CGDebugInfo | ( | CodeGenModule & | CGM | ) |
Definition at line 152 of file CGDebugInfo.cpp.
| CGDebugInfo::~CGDebugInfo | ( | ) |
Definition at line 159 of file CGDebugInfo.cpp.
| void CGDebugInfo::addCallTargetIfVirtual | ( | const FunctionDecl * | FD, |
| llvm::CallBase * | CI ) |
Add call target information.
Definition at line 5321 of file CGDebugInfo.cpp.
| void CGDebugInfo::addHeapAllocSiteMetadata | ( | llvm::CallBase * | CallSite, |
| QualType | AllocatedTy, | ||
| SourceLocation | Loc ) |
Add heapallocsite metadata for MSAllocator calls.
Definition at line 3193 of file CGDebugInfo.cpp.
References clang::Type::isVoidType().
| void CGDebugInfo::addInstToCurrentSourceAtom | ( | llvm::Instruction * | KeyInstruction, |
| llvm::Value * | Backup ) |
Add KeyInstruction and an optional Backup instruction to the current atom group, created using ApplyAtomGroup.
Definition at line 194 of file CGDebugInfo.cpp.
References addInstToSpecificSourceAtom().
| void CGDebugInfo::addInstToSpecificSourceAtom | ( | llvm::Instruction * | KeyInstruction, |
| llvm::Value * | Backup, | ||
| uint64_t | Atom ) |
Add KeyInstruction and an optional Backup instruction to the atom group Atom.
Definition at line 200 of file CGDebugInfo.cpp.
Referenced by addInstToCurrentSourceAtom().
| void CGDebugInfo::AddStringLiteralDebugInfo | ( | llvm::GlobalVariable * | GV, |
| const StringLiteral * | S ) |
DebugInfo isn't attached to string literals by default.
While certain aspects of debuginfo aren't useful for string literals (like a name), it's nice to be able to symbolize the line and column information. This is especially useful for sanitizers, as it allows symbolization of heap-buffer-overflows on constant strings.
Definition at line 6668 of file CGDebugInfo.cpp.
References clang::File, getMacroDebugLoc(), clang::SourceManager::getPresumedLoc(), clang::StringLiteral::getStrTokenLoc(), clang::Expr::getType(), and clang::PresumedLoc::isValid().
Referenced by clang::CodeGen::CodeGenModule::GetAddrOfConstantStringFromLiteral().
| void CGDebugInfo::completeClass | ( | const RecordDecl * | RD | ) |
Definition at line 3283 of file CGDebugInfo.cpp.
References clang::cast(), and clang::CanQual< T >::getAsOpaquePtr().
Referenced by completeClassData(), and getOrCreatePreserveAccessInfo().
| void CGDebugInfo::completeClassData | ( | const RecordDecl * | RD | ) |
Definition at line 3269 of file CGDebugInfo.cpp.
References completeClass(), clang::RecordDecl::getDefinition(), isClassOrMethodDLLImport(), and isDefinedInClangModule().
Referenced by completeRequiredType(), completeStandardLayoutUnionType(), and completeUnusedClass().
| void CGDebugInfo::completeFunction | ( | ) |
Reset internal state.
Definition at line 232 of file CGDebugInfo.cpp.
| void CGDebugInfo::completeRequiredType | ( | const RecordDecl * | RD | ) |
Definition at line 3413 of file CGDebugInfo.cpp.
References completeClassData(), clang::Decl::getLangOpts(), shouldOmitDefinition(), and clang::T.
Referenced by completeType().
| void CGDebugInfo::completeTemplateDefinition | ( | const ClassTemplateSpecializationDecl & | SD | ) |
Definition at line 4388 of file CGDebugInfo.cpp.
References completeUnusedClass().
| void CGDebugInfo::completeType | ( | const EnumDecl * | ED | ) |
Definition at line 3208 of file CGDebugInfo.cpp.
References clang::cast(), and clang::CanQual< T >::getAsOpaquePtr().
| void CGDebugInfo::completeType | ( | const RecordDecl * | RD | ) |
Definition at line 3221 of file CGDebugInfo.cpp.
References completeRequiredType().
| void CGDebugInfo::completeUnusedClass | ( | const CXXRecordDecl & | D | ) |
Definition at line 4393 of file CGDebugInfo.cpp.
References completeClassData(), and clang::CXXRecordDecl::isDynamicClass().
Referenced by completeTemplateDefinition().
| llvm::DIMacro * CGDebugInfo::CreateMacro | ( | llvm::DIMacroFile * | Parent, |
| unsigned | MType, | ||
| SourceLocation | LineLoc, | ||
| StringRef | Name, | ||
| StringRef | Value ) |
Create debug info for a macro defined by a #define directive or a macro undefined by a #undef directive.
Definition at line 4251 of file CGDebugInfo.cpp.
References clang::SourceLocation::isInvalid(), and clang::Line.
| llvm::DILocation * CGDebugInfo::CreateSyntheticInlineAt | ( | llvm::DebugLoc | ParentLocation, |
| llvm::DISubprogram * | SynthSubprogram ) |
Create a debug location from Location that adds an artificial inline frame where the frame name is FuncName.
This is used to indiciate instructions that come from compiler instrumentation.
Definition at line 4267 of file CGDebugInfo.cpp.
Referenced by CreateSyntheticInlineAt(), and CreateTrapFailureMessageFor().
| llvm::DILocation * CGDebugInfo::CreateSyntheticInlineAt | ( | llvm::DebugLoc | ParentLocation, |
| StringRef | SynthFuncName, | ||
| llvm::DIFile * | SynthFile ) |
Definition at line 4274 of file CGDebugInfo.cpp.
References CreateSyntheticInlineAt().
| llvm::DIMacroFile * CGDebugInfo::CreateTempMacroFile | ( | llvm::DIMacroFile * | Parent, |
| SourceLocation | LineLoc, | ||
| SourceLocation | FileLoc ) |
Create debug info for a file referenced by an #include directive.
Definition at line 4258 of file CGDebugInfo.cpp.
References clang::SourceLocation::isInvalid(), and clang::Line.
| llvm::DILocation * CGDebugInfo::CreateTrapFailureMessageFor | ( | llvm::DebugLoc | TrapLocation, |
| StringRef | Category, | ||
| StringRef | FailureMsg ) |
Create a debug location from TrapLocation that adds an artificial inline frame where the frame name is.
<Prefix> is "__clang_trap_msg".
This is used to store failure reasons for traps.
Definition at line 4281 of file CGDebugInfo.cpp.
References ClangTrapPrefix, and CreateSyntheticInlineAt().
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), and clang::CodeGen::CodeGenFunction::EmitTrapCheck().
| void CGDebugInfo::EmitAndRetainType | ( | QualType | Ty | ) |
Emit the type even if it might not be used.
Definition at line 6895 of file CGDebugInfo.cpp.
| llvm::DILocalVariable * CGDebugInfo::EmitDeclareOfArgVariable | ( | const VarDecl * | Decl, |
| llvm::Value * | AI, | ||
| unsigned | ArgNo, | ||
| CGBuilderTy & | Builder, | ||
| bool | UsePointerValue = false ) |
Emit call to llvm.dbg.declare for an argument variable declaration.
Definition at line 5982 of file CGDebugInfo.cpp.
| llvm::DILocalVariable * CGDebugInfo::EmitDeclareOfAutoVariable | ( | const VarDecl * | Decl, |
| llvm::Value * | AI, | ||
| CGBuilderTy & | Builder, | ||
| const bool | UsePointerValue = false ) |
Emit call to llvm.dbg.declare for an automatic variable declaration.
Returns a pointer to the DILocalVariable associated with the llvm.dbg.declare, or nullptr otherwise.
Definition at line 5855 of file CGDebugInfo.cpp.
References clang::ValueDecl::getType(), and clang::Type::isReferenceType().
Referenced by clang::CodeGen::CodeGenFunction::EmitAndRegisterVariableArrayDimensions().
| void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable | ( | const VarDecl * | variable, |
| llvm::Value * | storage, | ||
| CGBuilderTy & | Builder, | ||
| const CGBlockInfo & | blockInfo, | ||
| llvm::Instruction * | InsertPoint = nullptr ) |
Emit call to llvm.dbg.declare for an imported variable declaration in a block.
Definition at line 5909 of file CGDebugInfo.cpp.
References clang::cast(), clang::Column, clang::CharUnits::fromQuantity(), clang::CodeGen::CGBlockInfo::getCapture(), getDeclAlignIfRequired(), clang::CodeGen::CGBlockInfo::Capture::getIndex(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::CharUnits::getQuantity(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::SourceLocation::isValid(), clang::Line, clang::ObjCSelf, and clang::CodeGen::CGBlockInfo::StructureType.
| void CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable | ( | const CGBlockInfo & | block, |
| StringRef | Name, | ||
| unsigned | ArgNo, | ||
| llvm::AllocaInst * | LocalAddr, | ||
| CGBuilderTy & | Builder ) |
Emit call to llvm.dbg.declare for the block-literal argument to a block invocation function.
Definition at line 6037 of file CGDebugInfo.cpp.
References clang::TypeInfo::Align, clang::AS_public, clang::ast_matchers::blockDecl, clang::CodeGen::CGBlockInfo::BlockSize, clang::C, clang::BlockDecl::Capture::Capture(), clang::cast(), clang::CodeGen::CGBlockInfo::CXXThisIndex, clang::CodeGen::CGBlockInfo::getBlockDecl(), clang::CodeGen::CGBlockInfo::getCapture(), getDeclAlignIfRequired(), clang::CodeGen::CGBlockInfo::Capture::getIndex(), clang::NamedDecl::getName(), clang::ValueDecl::getType(), clang::BlockDecl::Capture::getVariable(), clang::TypeInfo::isAlignRequired(), clang::BlockDecl::Capture::isByRef(), clang::CodeGen::CGBlockInfo::Capture::isConstant(), clang::CodeGen::CGBlockInfo::StructureType, clang::ast_matchers::type, and clang::TypeInfo::Width.
| void CGDebugInfo::EmitExplicitCastType | ( | QualType | Ty | ) |
Emit the type explicitly casted to.
Definition at line 6889 of file CGDebugInfo.cpp.
| void CGDebugInfo::EmitExternalVariable | ( | llvm::GlobalVariable * | GV, |
| const VarDecl * | Decl ) |
Emit information about an external variable.
Definition at line 6567 of file CGDebugInfo.cpp.
References getDeclAlignIfRequired(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::ValueDecl::getType(), and clang::Decl::hasAttr().
Referenced by clang::CodeGen::CodeGenModule::EmitExternalDeclaration().
| void CGDebugInfo::EmitFuncDeclForCallSite | ( | llvm::CallBase * | CallOrInvoke, |
| QualType | CalleeType, | ||
| GlobalDecl | CalleeGlobalDecl ) |
Emit debug info for an extern function being called.
This is needed for call site debug info.
Definition at line 5338 of file CGDebugInfo.cpp.
References clang::cast(), EmitFunctionDecl(), clang::Func, getCallSiteRelatedAttrs(), clang::FunctionDecl::getCanonicalDecl(), clang::GlobalDecl::getDecl(), clang::Decl::getLocation(), clang::FunctionDecl::getMostRecentDecl(), clang::Decl::hasAttr(), clang::isa(), clang::FunctionDecl::isInlined(), and clang::FunctionDecl::isStatic().
| void CGDebugInfo::EmitFunctionDecl | ( | GlobalDecl | GD, |
| SourceLocation | Loc, | ||
| QualType | FnType, | ||
| llvm::Function * | Fn = nullptr ) |
Emit debug info for a function declaration.
Fn is set only when a declaration for a debug call site gets created.
Definition at line 5248 of file CGDebugInfo.cpp.
References clang::CodeGen::Decl, clang::GlobalDecl::getDecl(), clang::isa(), clang::Decl::isImplicit(), clang::SourceLocation::isInvalid(), and true.
Referenced by clang::CodeGen::CodeGenModule::EmitExternalDeclaration(), and EmitFuncDeclForCallSite().
| void CGDebugInfo::EmitFunctionEnd | ( | CGBuilderTy & | Builder, |
| llvm::Function * | Fn ) |
Constructs the debug code for exiting a function.
Definition at line 5471 of file CGDebugInfo.cpp.
References EmitLocation().
Referenced by EmitInlineFunctionEnd().
| void CGDebugInfo::emitFunctionStart | ( | GlobalDecl | GD, |
| SourceLocation | Loc, | ||
| SourceLocation | ScopeLoc, | ||
| QualType | FnType, | ||
| llvm::Function * | Fn, | ||
| bool | CurFnIsThunk ) |
Emit a call to llvm.dbg.function.start to indicate start of a new function.
| Loc | The location of the function header. |
| ScopeLoc | The location of the function body. |
Definition at line 5133 of file CGDebugInfo.cpp.
References clang::cast(), clang::CodeGen::Decl, getCallSiteRelatedAttrs(), clang::Decl::getCanonicalDecl(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDynamicInitKind(), clang::Decl::hasAttr(), clang::isa(), clang::Decl::isImplicit(), clang::SourceLocation::isValid(), and clang::NoStub.
| void CGDebugInfo::EmitGlobalAlias | ( | const llvm::GlobalValue * | GV, |
| const GlobalDecl | Decl ) |
Emit information about global variable alias.
Definition at line 6627 of file CGDebugInfo.cpp.
References clang::cast(), clang::GlobalDecl::getCanonicalDecl(), clang::GlobalDecl::getDecl(), clang::Decl::getLocation(), and clang::Decl::hasAttr().
Referenced by clang::CodeGen::CodeGenModule::EmitExternalDeclaration().
Emit a constant global variable's debug info.
Definition at line 6494 of file CGDebugInfo.cpp.
References clang::cast(), clang::Decl::getCanonicalDecl(), getDeclAlignIfRequired(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::Init, clang::isa(), and clang::T.
| void CGDebugInfo::EmitGlobalVariable | ( | llvm::GlobalVariable * | GV, |
| const VarDecl * | Decl ) |
Emit information about a global variable.
Definition at line 6428 of file CGDebugInfo.cpp.
References clang::cast(), clang::cuda_constant, clang::cuda_shared, clang::VarDecl::getCanonicalDecl(), getDeclAlignIfRequired(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::RecordDecl::isAnonymousStructOrUnion(), and clang::T.
Referenced by clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().
| void CGDebugInfo::EmitImportDecl | ( | const ImportDecl & | ID | ) |
Emit an @import declaration.
Definition at line 6752 of file CGDebugInfo.cpp.
References clang::cast().
| void CGDebugInfo::EmitInlineFunctionEnd | ( | CGBuilderTy & | Builder | ) |
End an inlined function scope.
Definition at line 5396 of file CGDebugInfo.cpp.
References EmitFunctionEnd(), getInlinedAt(), and setInlinedAt().
| void CGDebugInfo::EmitInlineFunctionStart | ( | CGBuilderTy & | Builder, |
| GlobalDecl | GD ) |
Start a new scope for an inlined function.
Definition at line 5381 of file CGDebugInfo.cpp.
References clang::cast(), EmitLocation(), clang::GlobalDecl::getDecl(), and setInlinedAt().
| void CGDebugInfo::EmitLabel | ( | const LabelDecl * | D, |
| CGBuilderTy & | Builder ) |
Emit call to llvm.dbg.label for an label.
Definition at line 5872 of file CGDebugInfo.cpp.
References clang::cast(), clang::Column, clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::Decl::hasAttr(), and clang::Line.
| void CGDebugInfo::EmitLexicalBlockEnd | ( | CGBuilderTy & | Builder, |
| SourceLocation | Loc ) |
Emit metadata to indicate the end of a new lexical block and pop the current block.
Definition at line 5458 of file CGDebugInfo.cpp.
References EmitLocation().
Referenced by clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolStmt(), and clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt().
| void CGDebugInfo::EmitLexicalBlockStart | ( | CGBuilderTy & | Builder, |
| SourceLocation | Loc ) |
Emit metadata to indicate the beginning of a new lexical block and push the block onto the stack.
Definition at line 5441 of file CGDebugInfo.cpp.
References setLocation().
Referenced by clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolStmt(), and clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt().
| void CGDebugInfo::EmitLocation | ( | CGBuilderTy & | Builder, |
| SourceLocation | Loc ) |
Emit metadata to indicate a change in line/column information in the source file.
If the location is invalid, the previous location will be reused.
Definition at line 5402 of file CGDebugInfo.cpp.
References setLocation().
Referenced by EmitFunctionEnd(), EmitInlineFunctionStart(), and EmitLexicalBlockEnd().
| llvm::DIImportedEntity * CGDebugInfo::EmitNamespaceAlias | ( | const NamespaceAliasDecl & | NA | ) |
Emit C++ namespace alias.
Definition at line 6766 of file CGDebugInfo.cpp.
References clang::cast(), EmitNamespaceAlias(), clang::NamespaceAliasDecl::getAliasedNamespace(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), and clang::NamedDecl::getName().
Referenced by EmitNamespaceAlias().
| void CGDebugInfo::EmitPseudoVariable | ( | CGBuilderTy & | Builder, |
| llvm::Instruction * | Value, | ||
| QualType | Ty ) |
Emit a pseudo variable and debug info for an intermediate value if it does not correspond to a variable in the source code, so that a profiler can track more accurate usage of certain instructions of interest.
Definition at line 6586 of file CGDebugInfo.cpp.
References clang::CodeGen::Type.
| void CGDebugInfo::EmitUsingDecl | ( | const UsingDecl & | UD | ) |
Emit C++ using declaration.
Definition at line 6716 of file CGDebugInfo.cpp.
References EmitUsingShadowDecl(), clang::Type::getContainedAutoType(), clang::BaseUsingDecl::shadow_size(), and clang::BaseUsingDecl::shadows().
| void CGDebugInfo::EmitUsingDirective | ( | const UsingDirectiveDecl & | UD | ) |
Emit C++ using directive.
Definition at line 6691 of file CGDebugInfo.cpp.
References clang::cast(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::UsingDirectiveDecl::getNominatedNamespace(), clang::NamespaceDecl::isAnonymousNamespace(), and clang::SourceLocation::isValid().
| void CGDebugInfo::EmitUsingEnumDecl | ( | const UsingEnumDecl & | UD | ) |
Emit C++ using-enum declaration.
Definition at line 6741 of file CGDebugInfo.cpp.
References EmitUsingShadowDecl(), clang::BaseUsingDecl::shadow_size(), and clang::BaseUsingDecl::shadows().
| void CGDebugInfo::EmitUsingShadowDecl | ( | const UsingShadowDecl & | USD | ) |
Emit a shadow decl brought in by a using or using-enum.
Definition at line 6706 of file CGDebugInfo.cpp.
References clang::cast(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::NamedDecl::getUnderlyingDecl(), and clang::Target.
Referenced by EmitUsingDecl(), and EmitUsingEnumDecl().
| void CGDebugInfo::emitVTableSymbol | ( | llvm::GlobalVariable * | VTable, |
| const CXXRecordDecl * | RD ) |
Emit symbol for debugger that holds the pointer to the vtable.
Definition at line 2994 of file CGDebugInfo.cpp.
References clang::AS_private, clang::cast(), and getAccessFlag().
| void CGDebugInfo::finalize | ( | ) |
Definition at line 6812 of file CGDebugInfo.cpp.
References clang::cast(), clang::QualType::getAsOpaquePtr(), clang::ObjCInterfaceType::getDecl(), and clang::ObjCInterfaceDecl::getDefinition().
| llvm::DINode::DIFlags CGDebugInfo::getCallSiteRelatedAttrs | ( | ) | const |
Return flags which enable debug info emission for call sites, provided that it is supported and enabled.
Definition at line 6910 of file CGDebugInfo.cpp.
Referenced by EmitFuncDeclForCallSite(), and emitFunctionStart().
|
inline |
Definition at line 692 of file CGDebugInfo.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitCoroutineBody().
| llvm::DIScope * CGDebugInfo::getDeclarationLexicalScope | ( | const Decl * | D | ) |
Get lexical scope of AST declaration.
Definition at line 434 of file CGDebugInfo.cpp.
References clang::cast(), clang::CodeGen::Decl, and clang::Decl::getCanonicalDecl().
| llvm::DenseMap< const llvm::DIFile *, OptionalFileEntryRef > CGDebugInfo::getDIFileSources | ( | ) | const |
Return the source file each DIFile was created for, or std::nullopt for a DIFile shared by several files.
DIFiles of files with line directives are omitted, because debug locations in them use presumed lines. Line directives are only all known once the translation unit is parsed.
Definition at line 679 of file CGDebugInfo.cpp.
References clang::SrcMgr::SLocEntry::getFile(), clang::SourceManager::getFileEntryRefForID(), clang::SourceManager::getSLocEntry(), and clang::SrcMgr::FileInfo::hasLineDirectives().
| QualType CGDebugInfo::getFunctionType | ( | const FunctionDecl * | FD, |
| QualType | RetTy, | ||
| const SmallVectorImpl< const VarDecl * > & | Args ) |
Definition at line 5120 of file CGDebugInfo.cpp.
References clang::CC_C, clang::Type::getAs(), and clang::ValueDecl::getType().
|
inline |
Definition at line 514 of file CGDebugInfo.h.
Referenced by EmitInlineFunctionEnd().
|
inline |
Return the current source location.
This does not necessarily correspond to the IRBuilder's current DebugLoc.
Definition at line 507 of file CGDebugInfo.h.
| llvm::DIType * CGDebugInfo::getOrCreateInterfaceType | ( | QualType | Ty, |
| SourceLocation | Loc ) |
Emit an Objective-C interface type standalone debug info.
Definition at line 3177 of file CGDebugInfo.cpp.
References getOrCreateStandaloneType().
| std::pair< llvm::DIType *, unsigned > CGDebugInfo::getOrCreatePreserveAccessInfo | ( | QualType | Ty, |
| const FieldDecl * | Field ) |
Return the complete record type and field index for preserve-access intrinsics.
Definition at line 3161 of file CGDebugInfo.cpp.
References completeClass(), clang::Decl::getLocation(), getOrCreateStandaloneType(), clang::DeclContext::getParent(), and clang::T.
Referenced by clang::CodeGen::CodeGenFunction::EmitLValueForField(), and emitPreserveStructAccess().
| llvm::DIType * CGDebugInfo::getOrCreateStandaloneType | ( | QualType | Ty, |
| SourceLocation | Loc ) |
Emit standalone debug info for a type.
Definition at line 3182 of file CGDebugInfo.cpp.
References clang::QualType::getAsOpaquePtr(), clang::QualType::isNull(), and clang::T.
Referenced by emitArraySubscriptGEP(), clang::CodeGen::CodeGenFunction::EmitBPFBuiltinExpr(), getOrCreateInterfaceType(), and getOrCreatePreserveAccessInfo().
|
inline |
Definition at line 691 of file CGDebugInfo.h.
| void CGDebugInfo::recordDeclarationLexicalScope | ( | const Decl & | D | ) |
Map AST declaration to its lexical block scope if available.
Definition at line 428 of file CGDebugInfo.cpp.
References clang::CodeGen::Decl, and clang::Decl::getCanonicalDecl().
|
inline |
Register VLA size expression debug node with the qualified type.
Definition at line 481 of file CGDebugInfo.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitAndRegisterVariableArrayDimensions().
| std::string CGDebugInfo::remapDIPath | ( | StringRef | Path | ) | const |
Remap a given path with the current debug prefix map.
Definition at line 732 of file CGDebugInfo.cpp.
| void CGDebugInfo::setDwoId | ( | uint64_t | Signature | ) |
Module debugging: Support for building PCMs.
Set the main CU's DwoId field to Signature.
Definition at line 6807 of file CGDebugInfo.cpp.
|
inline |
Update the current inline scope.
All subsequent calls to EmitLocation will create a location with this inlinedAt field.
Definition at line 511 of file CGDebugInfo.h.
Referenced by EmitInlineFunctionEnd(), and EmitInlineFunctionStart().
| void CGDebugInfo::setLocation | ( | SourceLocation | Loc | ) |
Update the current source location.
If
Definition at line 355 of file CGDebugInfo.cpp.
References clang::cast(), clang::PresumedLoc::getColumn(), clang::SourceManager::getExpansionLoc(), clang::PresumedLoc::getLine(), getMacroDebugLoc(), clang::SourceManager::getPresumedLoc(), clang::isa(), clang::PresumedLoc::isInvalid(), and clang::SourceLocation::isInvalid().
Referenced by EmitLexicalBlockStart(), EmitLocation(), and clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().
|
inline |
When generating debug information for a clang module or precompiled header, this module map will be used to determine the module of origin of each Decl.
Definition at line 493 of file CGDebugInfo.h.
|
inline |
When generating debug information for a clang module or precompiled header, this module map will be used to determine the module of origin of each Decl.
Definition at line 498 of file CGDebugInfo.h.
References clang::PCH.
| llvm::DebugLoc CGDebugInfo::SourceLocToDebugLoc | ( | SourceLocation | Loc | ) |
Definition at line 6901 of file CGDebugInfo.cpp.
|
friend |
Definition at line 62 of file CGDebugInfo.h.
References ApplyAtomGroup.
Referenced by ApplyAtomGroup.
|
friend |
Definition at line 61 of file CGDebugInfo.h.
References ApplyDebugLocation.
Referenced by ApplyDebugLocation.
| uint64_t clang::CodeGen::CGDebugInfo::CurrentAtom = 0 |
Definition at line 212 of file CGDebugInfo.h.
| uint64_t clang::CodeGen::CGDebugInfo::HighestEmittedAtom = 0 |
Definition at line 211 of file CGDebugInfo.h.
| uint64_t clang::CodeGen::CGDebugInfo::NextAtom = 1 |
Definition at line 210 of file CGDebugInfo.h.