clang
8.0.0
|
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/llvm-www-releases/8.0.0/docsbuild/llvm.src/tools/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. More... | |
void | registerVLASizeExpression (QualType Ty, llvm::Metadata *SizeExpr) |
Register VLA size expression debug node with the qualified type. More... | |
void | setLocation (SourceLocation Loc) |
Update the current source location. More... | |
SourceLocation | getLocation () const |
Return the current source location. More... | |
void | setInlinedAt (llvm::MDNode *InlinedAt) |
Update the current inline scope. More... | |
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. More... | |
void | EmitFunctionStart (GlobalDecl GD, SourceLocation Loc, SourceLocation ScopeLoc, QualType FnType, llvm::Function *Fn, bool CurFnIsThunk, CGBuilderTy &Builder) |
Emit a call to llvm.dbg.function.start to indicate start of a new function. More... | |
void | EmitInlineFunctionStart (CGBuilderTy &Builder, GlobalDecl GD) |
Start a new scope for an inlined function. More... | |
void | EmitInlineFunctionEnd (CGBuilderTy &Builder) |
End an inlined function scope. More... | |
void | EmitFunctionDecl (GlobalDecl GD, SourceLocation Loc, QualType FnType) |
Emit debug info for a function declaration. More... | |
void | EmitFunctionEnd (CGBuilderTy &Builder, llvm::Function *Fn) |
Constructs the debug code for exiting a function. More... | |
void | EmitLexicalBlockStart (CGBuilderTy &Builder, SourceLocation Loc) |
Emit metadata to indicate the beginning of a new lexical block and push the block onto the stack. More... | |
void | EmitLexicalBlockEnd (CGBuilderTy &Builder, SourceLocation Loc) |
Emit metadata to indicate the end of a new lexical block and pop the current block. More... | |
llvm::DILocalVariable * | EmitDeclareOfAutoVariable (const VarDecl *Decl, llvm::Value *AI, CGBuilderTy &Builder) |
Emit call to llvm.dbg.declare for an automatic variable declaration. More... | |
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. More... | |
void | EmitDeclareOfArgVariable (const VarDecl *Decl, llvm::Value *AI, unsigned ArgNo, CGBuilderTy &Builder) |
Emit call to llvm.dbg.declare for an argument variable declaration. More... | |
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. More... | |
void | EmitGlobalVariable (llvm::GlobalVariable *GV, const VarDecl *Decl) |
Emit information about a global variable. More... | |
void | EmitGlobalVariable (const ValueDecl *VD, const APValue &Init) |
Emit a constant global variable's debug info. More... | |
void | EmitUsingDirective (const UsingDirectiveDecl &UD) |
Emit C++ using directive. More... | |
void | EmitExplicitCastType (QualType Ty) |
Emit the type explicitly casted to. More... | |
void | EmitUsingDecl (const UsingDecl &UD) |
Emit C++ using declaration. More... | |
void | EmitImportDecl (const ImportDecl &ID) |
Emit an declaration. More... | |
llvm::DIImportedEntity * | EmitNamespaceAlias (const NamespaceAliasDecl &NA) |
Emit C++ namespace alias. More... | |
llvm::DIType * | getOrCreateRecordType (QualType Ty, SourceLocation L) |
Emit record type's standalone debug info. More... | |
llvm::DIType * | getOrCreateInterfaceType (QualType Ty, SourceLocation Loc) |
Emit an Objective-C interface type standalone debug info. More... | |
llvm::DIType * | getOrCreateStandaloneType (QualType Ty, SourceLocation Loc) |
Emit standalone debug info for a type. More... | |
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. More... | |
llvm::DIMacroFile * | CreateTempMacroFile (llvm::DIMacroFile *Parent, SourceLocation LineLoc, SourceLocation FileLoc) |
Create debug info for a file referenced by an #include directive. More... | |
void | setDwoId (uint64_t Signature) |
Module debugging: Support for building PCMs. More... | |
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. More... | |
void | setPCHDescriptor (ExternalASTSource::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. More... | |
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 54 of file CGDebugInfo.h.
CGDebugInfo::CGDebugInfo | ( | CodeGenModule & | CGM | ) |
Definition at line 65 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::DebugPrefixMap, and clang::CodeGen::CodeGenModule::getCodeGenOpts().
CGDebugInfo::~CGDebugInfo | ( | ) |
Definition at line 74 of file CGDebugInfo.cpp.
void CGDebugInfo::completeClass | ( | const RecordDecl * | RD | ) |
Definition at line 2032 of file CGDebugInfo.cpp.
References clang::Type::castAs(), clang::codegenoptions::DebugLineTablesOnly, and clang::QualType::getAsOpaquePtr().
void CGDebugInfo::completeClassData | ( | const RecordDecl * | RD | ) |
Definition at line 2018 of file CGDebugInfo.cpp.
References clang::RecordDecl::getDefinition(), isClassOrMethodDLLImport(), and isDefinedInClangModule().
void CGDebugInfo::completeRequiredType | ( | const RecordDecl * | RD | ) |
Definition at line 2101 of file CGDebugInfo.cpp.
References clang::ObjCObjectType::getBaseType(), clang::RecordType::getDecl(), clang::ObjCTypeParamType::getDecl(), clang::RecordDecl::getDefinition(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::TypedefNameDecl::getUnderlyingType(), clang::TagDecl::isCompleteDefinition(), and shouldOmitDefinition().
void CGDebugInfo::completeTemplateDefinition | ( | const ClassTemplateSpecializationDecl & | SD | ) |
Definition at line 2808 of file CGDebugInfo.cpp.
References clang::codegenoptions::DebugLineTablesOnly.
void CGDebugInfo::completeType | ( | const EnumDecl * | ED | ) |
Definition at line 1957 of file CGDebugInfo.cpp.
References clang::Type::castAs(), clang::codegenoptions::DebugLineTablesOnly, and clang::QualType::getAsOpaquePtr().
void CGDebugInfo::completeType | ( | const RecordDecl * | RD | ) |
Definition at line 1970 of file CGDebugInfo.cpp.
References clang::codegenoptions::LimitedDebugInfo.
void CGDebugInfo::completeUnusedClass | ( | const CXXRecordDecl & | D | ) |
Definition at line 2815 of file CGDebugInfo.cpp.
References clang::Auto, clang::codegenoptions::DebugLineTablesOnly, clang::QualType::getAsOpaquePtr(), clang::RecordType::getDecl(), getDeclAlignIfRequired(), clang::RecordDecl::getDefinition(), getDefinition(), clang::Decl::getLocation(), clang::Decl::getOwningModule(), clang::Decl::getOwningModuleID(), clang::ASTRecordLayout::getPrimaryBase(), getTagForRecord(), clang::Type::getTypeClass(), getTypeIdentifier(), clang::QualType::hasLocalQualifiers(), Identifier, clang::TagDecl::isCompleteDefinition(), clang::CXXRecordDecl::isDynamicClass(), clang::Decl::isFromASTFile(), clang::QualType::isNull(), clang::ASTRecordLayout::isPrimaryBaseVirtual(), Line, Paren, clang::CodeGen::CGCXXABI::RAA_Indirect, and UnwrapTypeForDebugInfo().
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 2716 of file CGDebugInfo.cpp.
Referenced by 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 2723 of file CGDebugInfo.cpp.
References clang::SourceLocation::isInvalid(), and Line.
void CGDebugInfo::EmitDeclareOfArgVariable | ( | const VarDecl * | Decl, |
llvm::Value * | AI, | ||
unsigned | ArgNo, | ||
CGBuilderTy & | Builder | ||
) |
Emit call to llvm.dbg.declare
for an argument variable declaration.
Definition at line 3945 of file CGDebugInfo.cpp.
References clang::AS_public, clang::ASTContext::getBlockDescriptorExtendedType(), clang::ASTContext::getBlockDescriptorType(), clang::CodeGen::CGBlockInfo::getBlockExpr(), clang::BlockExpr::getFunctionType(), clang::ASTContext::getPointerType(), clang::ASTContext::IntTy, clang::codegenoptions::LimitedDebugInfo, clang::CodeGen::CGBlockInfo::NeedsCopyDispose, clang::operator<(), and clang::ASTContext::VoidPtrTy.
llvm::DILocalVariable * CGDebugInfo::EmitDeclareOfAutoVariable | ( | const VarDecl * | Decl, |
llvm::Value * | AI, | ||
CGBuilderTy & | Builder | ||
) |
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 3860 of file CGDebugInfo.cpp.
References clang::codegenoptions::LimitedDebugInfo, and clang::None.
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 3874 of file CGDebugInfo.cpp.
References 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::codegenoptions::LimitedDebugInfo, Line, clang::ImplicitParamDecl::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 4000 of file CGDebugInfo.cpp.
void CGDebugInfo::EmitExplicitCastType | ( | QualType | Ty | ) |
Emit the type explicitly casted to.
Definition at line 4471 of file CGDebugInfo.cpp.
References clang::codegenoptions::LimitedDebugInfo.
void CGDebugInfo::EmitFunctionDecl | ( | GlobalDecl | GD, |
SourceLocation | Loc, | ||
QualType | FnType | ||
) |
Emit debug info for a function declaration.
Definition at line 3518 of file CGDebugInfo.cpp.
void CGDebugInfo::EmitFunctionEnd | ( | CGBuilderTy & | Builder, |
llvm::Function * | Fn | ||
) |
Constructs the debug code for exiting a function.
Definition at line 3647 of file CGDebugInfo.cpp.
void CGDebugInfo::EmitFunctionStart | ( | GlobalDecl | GD, |
SourceLocation | Loc, | ||
SourceLocation | ScopeLoc, | ||
QualType | FnType, | ||
llvm::Function * | Fn, | ||
bool | CurFnIsThunk, | ||
CGBuilderTy & | Builder | ||
) |
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 3409 of file CGDebugInfo.cpp.
void CGDebugInfo::EmitGlobalVariable | ( | llvm::GlobalVariable * | GV, |
const VarDecl * | Decl | ||
) |
Emit information about a global variable.
Definition at line 4169 of file CGDebugInfo.cpp.
References clang::Type::castAs(), clang::VarDecl::getCanonicalDecl(), getDeclAlignIfRequired(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::RecordDecl::isAnonymousStructOrUnion(), clang::Type::isUnionType(), and clang::codegenoptions::LimitedDebugInfo.
Referenced by clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().
Emit a constant global variable's debug info.
Definition at line 4223 of file CGDebugInfo.cpp.
References getDeclAlignIfRequired(), clang::Decl::getLocation(), clang::Decl::hasAttr(), and clang::codegenoptions::LimitedDebugInfo.
void CGDebugInfo::EmitImportDecl | ( | const ImportDecl & | ID | ) |
Emit an declaration.
Definition at line 4336 of file CGDebugInfo.cpp.
References clang::Decl::getDeclContext(), clang::ImportDecl::getImportedModule(), and clang::Decl::getLocation().
void CGDebugInfo::EmitInlineFunctionEnd | ( | CGBuilderTy & | Builder | ) |
End an inlined function scope.
Definition at line 3577 of file CGDebugInfo.cpp.
Referenced by clang::CodeGen::ApplyInlineDebugLocation::~ApplyInlineDebugLocation().
void CGDebugInfo::EmitInlineFunctionStart | ( | CGBuilderTy & | Builder, |
GlobalDecl | GD | ||
) |
Start a new scope for an inlined function.
Definition at line 3562 of file CGDebugInfo.cpp.
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 3634 of file CGDebugInfo.cpp.
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 3617 of file CGDebugInfo.cpp.
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 3583 of file CGDebugInfo.cpp.
llvm::DIImportedEntity * CGDebugInfo::EmitNamespaceAlias | ( | const NamespaceAliasDecl & | NA | ) |
Emit C++ namespace alias.
Definition at line 4350 of file CGDebugInfo.cpp.
References clang::NamespaceAliasDecl::getAliasedNamespace(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::NamespaceDecl::isInline(), and clang::codegenoptions::LimitedDebugInfo.
void CGDebugInfo::EmitUsingDecl | ( | const UsingDecl & | UD | ) |
Emit C++ using declaration.
Definition at line 4309 of file CGDebugInfo.cpp.
References clang::Type::getAs(), clang::ValueDecl::getType(), clang::codegenoptions::LimitedDebugInfo, clang::UsingDecl::shadow_begin(), clang::UsingDecl::shadow_size(), and clang::Target.
void CGDebugInfo::EmitUsingDirective | ( | const UsingDirectiveDecl & | UD | ) |
Emit C++ using directive.
Definition at line 4296 of file CGDebugInfo.cpp.
References clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::UsingDirectiveDecl::getNominatedNamespace(), clang::NamespaceDecl::isAnonymousNamespace(), and clang::codegenoptions::LimitedDebugInfo.
void CGDebugInfo::finalize | ( | ) |
Definition at line 4396 of file CGDebugInfo.cpp.
References clang::if(), P, and clang::Type::Type().
|
inline |
Definition at line 383 of file CGDebugInfo.h.
References clang::markup::EmitLocation().
|
inline |
Return the current source location.
This does not necessarily correspond to the IRBuilder's current DebugLoc.
Definition at line 376 of file CGDebugInfo.h.
llvm::DIType * CGDebugInfo::getOrCreateInterfaceType | ( | QualType | Ty, |
SourceLocation | Loc | ||
) |
Emit an Objective-C interface type standalone debug info.
Definition at line 1941 of file CGDebugInfo.cpp.
llvm::DIType * CGDebugInfo::getOrCreateRecordType | ( | QualType | Ty, |
SourceLocation | L | ||
) |
Emit record type's standalone debug info.
Definition at line 1934 of file CGDebugInfo.cpp.
References clang::codegenoptions::LimitedDebugInfo.
llvm::DIType * CGDebugInfo::getOrCreateStandaloneType | ( | QualType | Ty, |
SourceLocation | Loc | ||
) |
Emit standalone debug info for a type.
Definition at line 1946 of file CGDebugInfo.cpp.
References clang::QualType::getAsOpaquePtr(), clang::QualType::isNull(), and clang::codegenoptions::LimitedDebugInfo.
|
inline |
Register VLA size expression debug node with the qualified type.
Definition at line 348 of file CGDebugInfo.h.
std::string CGDebugInfo::remapDIPath | ( | StringRef | Path | ) | const |
Remap a given path with the current debug prefix map.
Definition at line 473 of file CGDebugInfo.cpp.
References clang::QualifierCollector::apply(), clang::codegenoptions::DebugDirectivesOnly, clang::codegenoptions::DebugLineTablesOnly, clang::Qualifiers::empty(), clang::codegenoptions::FullDebugInfo, clang::getClangFullVersion(), clang::PresumedLoc::getColumn(), clang::SourceManager::getFileEntryForID(), clang::FrontendOptions::getInputKindForExtension(), clang::BuiltinType::getKind(), clang::PresumedLoc::getLine(), clang::SourceManager::getMainFileID(), clang::BuiltinType::getName(), clang::PointerType::getPointeeType(), clang::ObjCObjectPointerType::getPointeeType(), clang::SourceManager::getPresumedLoc(), clang::Qualifiers::hasConst(), clang::Qualifiers::hasRestrict(), clang::Qualifiers::hasVolatile(), clang::Type::isComplexIntegerType(), clang::SourceLocation::isInvalid(), clang::ObjCRuntime::isNonFragile(), clang::ObjCObjectPointerType::isObjCQualifiedIdType(), clang::SourceLocation::isValid(), clang::PresumedLoc::isValid(), clang::codegenoptions::LimitedDebugInfo, clang::codegenoptions::LocTrackingOnly, clang::codegenoptions::NoDebugInfo, clang::CodeGenOptions::NoFission, clang::XRayInstrKind::None, clang::LangOptions::ObjCRuntime, clang::Qualifiers::removeAddressSpace(), clang::Qualifiers::removeConst(), clang::Qualifiers::removeObjCGCAttr(), clang::Qualifiers::removeObjCLifetime(), clang::Qualifiers::removeRestrict(), clang::Qualifiers::removeVolatile(), and clang::QualifierCollector::strip().
void CGDebugInfo::setDwoId | ( | uint64_t | Signature | ) |
Module debugging: Support for building PCMs.
Set the main CU's DwoId field to Signature
.
Definition at line 4391 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 380 of file CGDebugInfo.h.
void CGDebugInfo::setLocation | ( | SourceLocation | Loc | ) |
Update the current source location.
If
Definition at line 168 of file CGDebugInfo.cpp.
References clang::Decl::getDeclContext(), clang::SourceManager::getPresumedLoc(), clang::SourceLocation::isInvalid(), and SM.
Referenced by 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 360 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 365 of file CGDebugInfo.h.
llvm::DebugLoc CGDebugInfo::SourceLocToDebugLoc | ( | SourceLocation | Loc | ) |
Definition at line 4480 of file CGDebugInfo.cpp.
References clang::codegenoptions::LocTrackingOnly, and clang::codegenoptions::NoDebugInfo.
|
friend |
Definition at line 55 of file CGDebugInfo.h.
|
friend |
Definition at line 56 of file CGDebugInfo.h.