clang 20.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 "/home/buildbot/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::MDNode *InlinedAt) |
Update the current inline scope. | |
llvm::MDNode * | 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, const FunctionDecl *CalleeDecl) |
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. | |
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. | |
llvm::DIType * | getOrCreateRecordType (QualType Ty, SourceLocation L) |
Emit record type's standalone debug info. | |
llvm::DIType * | getOrCreateInterfaceType (QualType Ty, SourceLocation Loc) |
Emit an Objective-C interface type standalone debug info. | |
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. | |
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 | SaveAndRestoreLocation |
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 58 of file CGDebugInfo.h.
CGDebugInfo::CGDebugInfo | ( | CodeGenModule & | CGM | ) |
Definition at line 112 of file CGDebugInfo.cpp.
CGDebugInfo::~CGDebugInfo | ( | ) |
Definition at line 119 of file CGDebugInfo.cpp.
void CGDebugInfo::addHeapAllocSiteMetadata | ( | llvm::CallBase * | CallSite, |
QualType | AllocatedTy, | ||
SourceLocation | Loc | ||
) |
Add heapallocsite metadata for MSAllocator calls.
Definition at line 2642 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getLLVMContext(), clang::Type::isVoidType(), and Loc.
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 5905 of file CGDebugInfo.cpp.
References clang::File, clang::CodeGen::CodeGenModule::getContext(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getSourceManager(), clang::PresumedLoc::isValid(), and Loc.
Referenced by clang::CodeGen::CodeGenModule::GetAddrOfConstantStringFromLiteral().
void CGDebugInfo::completeClass | ( | const RecordDecl * | RD | ) |
Definition at line 2732 of file CGDebugInfo.cpp.
References clang::Type::castAs(), clang::QualType::getAsOpaquePtr(), clang::CodeGen::CodeGenModule::getContext(), and clang::ASTContext::getRecordType().
Referenced by completeClassData().
void CGDebugInfo::completeClassData | ( | const RecordDecl * | RD | ) |
Definition at line 2718 of file CGDebugInfo.cpp.
References completeClass(), clang::RecordDecl::getDefinition(), clang::CodeGen::CodeGenModule::getVTableLinkage(), isClassOrMethodDLLImport(), and isDefinedInClangModule().
Referenced by completeRequiredType(), and completeUnusedClass().
void CGDebugInfo::completeRequiredType | ( | const RecordDecl * | RD | ) |
Definition at line 2844 of file CGDebugInfo.cpp.
References completeClassData(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::ASTContext::getRecordType(), shouldOmitDefinition(), and clang::T.
Referenced by completeType().
void CGDebugInfo::completeTemplateDefinition | ( | const ClassTemplateSpecializationDecl & | SD | ) |
Definition at line 3703 of file CGDebugInfo.cpp.
References completeUnusedClass().
void CGDebugInfo::completeType | ( | const EnumDecl * | ED | ) |
Definition at line 2657 of file CGDebugInfo.cpp.
References clang::Type::castAs(), clang::QualType::getAsOpaquePtr(), clang::CodeGen::CodeGenModule::getContext(), and clang::ASTContext::getEnumType().
void CGDebugInfo::completeType | ( | const RecordDecl * | RD | ) |
Definition at line 2670 of file CGDebugInfo.cpp.
References completeRequiredType(), and clang::CodeGen::CodeGenModule::getLangOpts().
void CGDebugInfo::completeUnusedClass | ( | const CXXRecordDecl & | D | ) |
Definition at line 3708 of file CGDebugInfo.cpp.
References completeClassData(), D, clang::QualType::getAsOpaquePtr(), clang::CodeGen::CodeGenModule::getContext(), and clang::ASTContext::getRecordType().
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 3581 of file CGDebugInfo.cpp.
References clang::SourceLocation::isInvalid(), clang::Line, and Parent.
Referenced by clang::MacroPPCallbacks::MacroDefined(), and clang::MacroPPCallbacks::MacroUndefined().
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 3588 of file CGDebugInfo.cpp.
References clang::SourceLocation::isInvalid(), clang::Line, and Parent.
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>:<Category>:<FailureMsg>
<Prefix>
is "__clang_trap_msg".
This is used to store failure reasons for traps.
Definition at line 3596 of file CGDebugInfo.cpp.
References Category, ClangTrapPrefix, and clang::CodeGen::CodeGenModule::getLLVMContext().
void CGDebugInfo::EmitAndRetainType | ( | QualType | Ty | ) |
Emit the type even if it might not be used.
Definition at line 6131 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), and clang::CodeGenOptions::hasMaybeUnusedDebugInfo().
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 5201 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), and clang::CodeGenOptions::hasReducedDebugInfo().
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 5075 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::ValueDecl::getType(), clang::CodeGenOptions::hasReducedDebugInfo(), and clang::Type::isReferenceType().
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 5128 of file CGDebugInfo.cpp.
References clang::Column, D, clang::CharUnits::fromQuantity(), clang::CodeGen::CGBlockInfo::getCapture(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getDataLayout(), getDeclAlignIfRequired(), clang::CodeGen::CGBlockInfo::Capture::getIndex(), clang::CodeGen::CodeGenModule::getLLVMContext(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::CharUnits::getQuantity(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::CodeGenOptions::hasReducedDebugInfo(), clang::SourceLocation::isValid(), clang::Line, clang::ObjCSelf, clang::CodeGen::CGBlockInfo::StructureType, and clang::ASTContext::toCharUnitsFromBits().
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 5256 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::CodeGen::CGBlockInfo::CXXThisIndex, clang::CodeGen::CGBlockInfo::getBlockDecl(), clang::CodeGen::CGBlockInfo::getCapture(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getDataLayout(), getDeclAlignIfRequired(), clang::CodeGen::CGBlockInfo::Capture::getIndex(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getLLVMContext(), clang::NamedDecl::getName(), clang::CXXMethodDecl::getThisType(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getUniqueBlockCount(), clang::BlockDecl::Capture::getVariable(), clang::CodeGenOptions::hasReducedDebugInfo(), clang::TypeInfo::isAlignRequired(), clang::BlockDecl::Capture::isByRef(), clang::CodeGen::CGBlockInfo::Capture::isConstant(), clang::CodeGen::CodeGenTypeCache::PointerWidthInBits, clang::CodeGen::CGBlockInfo::StructureType, clang::ASTContext::toBits(), clang::ast_matchers::type, and clang::TypeInfo::Width.
void CGDebugInfo::EmitExplicitCastType | ( | QualType | Ty | ) |
Emit the type explicitly casted to.
Definition at line 6125 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), and clang::CodeGenOptions::hasReducedDebugInfo().
void CGDebugInfo::EmitExternalVariable | ( | llvm::GlobalVariable * | GV, |
const VarDecl * | Decl | ||
) |
Emit information about an external variable.
Definition at line 5803 of file CGDebugInfo.cpp.
References D, clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getContext(), getDeclAlignIfRequired(), clang::Decl::getLocation(), clang::Decl::hasAttr(), and clang::CodeGenOptions::hasReducedDebugInfo().
void CGDebugInfo::EmitFuncDeclForCallSite | ( | llvm::CallBase * | CallOrInvoke, |
QualType | CalleeType, | ||
const FunctionDecl * | CalleeDecl | ||
) |
Emit debug info for an extern function being called.
This is needed for call site debug info.
Definition at line 4591 of file CGDebugInfo.cpp.
References EmitFunctionDecl(), clang::Func, clang::Decl::getLocation(), clang::Decl::hasAttr(), 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 4518 of file CGDebugInfo.cpp.
References D, clang::GlobalDecl::getDecl(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getTarget(), clang::TargetInfo::getTriple(), clang::Decl::isImplicit(), clang::SourceLocation::isInvalid(), Loc, and true.
Referenced by EmitFuncDeclForCallSite().
void CGDebugInfo::EmitFunctionEnd | ( | CGBuilderTy & | Builder, |
llvm::Function * | Fn | ||
) |
Constructs the debug code for exiting a function.
Definition at line 4701 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 4409 of file CGDebugInfo.cpp.
References D, clang::Decl::getCanonicalDecl(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDynamicInitKind(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::Decl::hasAttr(), clang::Decl::isImplicit(), clang::SourceLocation::isValid(), Loc, and clang::NoStub.
void CGDebugInfo::EmitGlobalAlias | ( | const llvm::GlobalValue * | GV, |
const GlobalDecl | Decl | ||
) |
Emit information about global variable alias.
Definition at line 5864 of file CGDebugInfo.cpp.
References D, clang::GlobalDecl::getCanonicalDecl(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::GlobalDecl::getDecl(), clang::Decl::getLocation(), clang::CodeGen::CodeGenModule::getMangledNameDecl(), clang::Decl::hasAttr(), clang::CodeGenOptions::hasReducedDebugInfo(), and Loc.
Emit a constant global variable's debug info.
Definition at line 5727 of file CGDebugInfo.cpp.
References clang::QualType::getAsOpaquePtr(), clang::Decl::getCanonicalDecl(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getContext(), getDeclAlignIfRequired(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::ASTContext::getRecordType(), clang::ValueDecl::getType(), clang::TypeDecl::getTypeForDecl(), clang::Decl::hasAttr(), clang::CodeGenOptions::hasReducedDebugInfo(), and clang::Init.
void CGDebugInfo::EmitGlobalVariable | ( | llvm::GlobalVariable * | GV, |
const VarDecl * | Decl | ||
) |
Emit information about a global variable.
Definition at line 5661 of file CGDebugInfo.cpp.
References clang::Type::castAs(), clang::cuda_constant, clang::cuda_shared, D, clang::Decl::getCanonicalDecl(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getContext(), getDeclAlignIfRequired(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::ASTContext::getTargetAddressSpace(), clang::CodeGen::CodeGenTypes::getTargetAddressSpace(), clang::CodeGen::CodeGenModule::getTypes(), clang::Decl::hasAttr(), clang::CodeGenOptions::hasReducedDebugInfo(), clang::RecordDecl::isAnonymousStructOrUnion(), clang::Type::isUnionType(), and clang::T.
void CGDebugInfo::EmitImportDecl | ( | const ImportDecl & | ID | ) |
Emit an @import declaration.
Definition at line 5988 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), and Loc.
void CGDebugInfo::EmitInlineFunctionEnd | ( | CGBuilderTy & | Builder | ) |
End an inlined function scope.
Definition at line 4630 of file CGDebugInfo.cpp.
References EmitFunctionEnd(), getInlinedAt(), and setInlinedAt().
Referenced by clang::CodeGen::ApplyInlineDebugLocation::~ApplyInlineDebugLocation().
void CGDebugInfo::EmitInlineFunctionStart | ( | CGBuilderTy & | Builder, |
GlobalDecl | GD | ||
) |
Start a new scope for an inlined function.
Definition at line 4615 of file CGDebugInfo.cpp.
References 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 5093 of file CGDebugInfo.cpp.
References clang::Column, D, clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getLLVMContext(), clang::Decl::getLocation(), clang::Decl::hasAttr(), clang::CodeGenOptions::hasReducedDebugInfo(), 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 4688 of file CGDebugInfo.cpp.
References EmitLocation(), and Loc.
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 4671 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getLLVMContext(), Loc, and setLocation().
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 4636 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getLLVMContext(), Loc, and setLocation().
Referenced by EmitFunctionEnd(), EmitInlineFunctionStart(), and EmitLexicalBlockEnd().
llvm::DIImportedEntity * CGDebugInfo::EmitNamespaceAlias | ( | const NamespaceAliasDecl & | NA | ) |
Emit C++ namespace alias.
Definition at line 6002 of file CGDebugInfo.cpp.
References EmitNamespaceAlias(), clang::NamespaceAliasDecl::getAliasedNamespace(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::CodeGenOptions::hasReducedDebugInfo(), and Loc.
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 5822 of file CGDebugInfo.cpp.
References D, clang::CodeGen::CodeGenModule::getCodeGenOpts(), and clang::CodeGen::Type.
void CGDebugInfo::EmitUsingDecl | ( | const UsingDecl & | UD | ) |
Emit C++ using declaration.
Definition at line 5952 of file CGDebugInfo.cpp.
References EmitUsingShadowDecl(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::Type::getContainedAutoType(), clang::CodeGenOptions::hasReducedDebugInfo(), clang::BaseUsingDecl::shadow_size(), and clang::BaseUsingDecl::shadows().
void CGDebugInfo::EmitUsingDirective | ( | const UsingDirectiveDecl & | UD | ) |
Emit C++ using directive.
Definition at line 5927 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::UsingDirectiveDecl::getNominatedNamespace(), clang::CodeGenOptions::hasReducedDebugInfo(), clang::NamespaceDecl::isAnonymousNamespace(), clang::SourceLocation::isValid(), and Loc.
void CGDebugInfo::EmitUsingEnumDecl | ( | const UsingEnumDecl & | UD | ) |
Emit C++ using-enum declaration.
Definition at line 5977 of file CGDebugInfo.cpp.
References EmitUsingShadowDecl(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGenOptions::hasReducedDebugInfo(), 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 5942 of file CGDebugInfo.cpp.
References clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::NamedDecl::getUnderlyingDecl(), and Loc.
Referenced by EmitUsingDecl(), and EmitUsingEnumDecl().
void CGDebugInfo::finalize | ( | ) |
Definition at line 6048 of file CGDebugInfo.cpp.
References E, clang::QualType::getAsOpaquePtr(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), and P.
|
inline |
Definition at line 620 of file CGDebugInfo.h.
QualType CGDebugInfo::getFunctionType | ( | const FunctionDecl * | FD, |
QualType | RetTy, | ||
const SmallVectorImpl< const VarDecl * > & | Args | ||
) |
Definition at line 4396 of file CGDebugInfo.cpp.
References clang::CC_C, clang::Type::getAs(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getFunctionType(), and clang::ValueDecl::getType().
|
inline |
Definition at line 457 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 450 of file CGDebugInfo.h.
llvm::DIType * CGDebugInfo::getOrCreateInterfaceType | ( | QualType | Ty, |
SourceLocation | Loc | ||
) |
Emit an Objective-C interface type standalone debug info.
Definition at line 2626 of file CGDebugInfo.cpp.
References D, getOrCreateStandaloneType(), and Loc.
llvm::DIType * CGDebugInfo::getOrCreateRecordType | ( | QualType | Ty, |
SourceLocation | L | ||
) |
Emit record type's standalone debug info.
Definition at line 2619 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGenOptions::hasReducedDebugInfo(), Loc, and clang::T.
llvm::DIType * CGDebugInfo::getOrCreateStandaloneType | ( | QualType | Ty, |
SourceLocation | Loc | ||
) |
Emit standalone debug info for a type.
Definition at line 2631 of file CGDebugInfo.cpp.
References D, clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGenOptions::hasReducedDebugInfo(), Loc, and clang::T.
Referenced by emitArraySubscriptGEP(), emitPreserveStructAccess(), and getOrCreateInterfaceType().
|
inline |
Definition at line 619 of file CGDebugInfo.h.
|
inline |
Register VLA size expression debug node with the qualified type.
Definition at line 424 of file CGDebugInfo.h.
std::string CGDebugInfo::remapDIPath | ( | StringRef | Path | ) | const |
Remap a given path with the current debug prefix map.
Definition at line 513 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::DebugPrefixMap, clang::CodeGen::CodeGenModule::getCodeGenOpts(), P, and Path.
void CGDebugInfo::setDwoId | ( | uint64_t | Signature | ) |
Module debugging: Support for building PCMs.
Set the main CU's DwoId field to Signature
.
Definition at line 6043 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 454 of file CGDebugInfo.h.
Referenced by EmitInlineFunctionEnd(), and EmitInlineFunctionStart().
void CGDebugInfo::setLocation | ( | SourceLocation | Loc | ) |
Update the current source location.
If
Definition at line 214 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getContext(), clang::SourceManager::getExpansionLoc(), clang::ASTContext::getSourceManager(), clang::SourceLocation::isInvalid(), clang::PresumedLoc::isInvalid(), Loc, and SM.
Referenced by EmitLexicalBlockStart(), and EmitLocation().
|
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 436 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 441 of file CGDebugInfo.h.
References clang::PCH.
llvm::DebugLoc CGDebugInfo::SourceLocToDebugLoc | ( | SourceLocation | Loc | ) |
Definition at line 6137 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getLLVMContext(), and Loc.
|
friend |
Definition at line 59 of file CGDebugInfo.h.
|
friend |
Definition at line 60 of file CGDebugInfo.h.