clang
3.9.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 <CGDebugInfo.h>
Public Member Functions | |
CGDebugInfo (CodeGenModule &CGM) | |
~CGDebugInfo () | |
void | finalize () |
void | setLocation (SourceLocation Loc) |
Update the current source location. More... | |
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, CGBuilderTy &Builder) |
Emit a call to llvm.dbg.function.start to indicate start of a new function. More... | |
void | EmitFunctionDecl (GlobalDecl GD, SourceLocation Loc, QualType FnType) |
Emit debug info for a function declaration. More... | |
void | EmitFunctionEnd (CGBuilderTy &Builder) |
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... | |
void | 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, llvm::Value *Arg, unsigned ArgNo, llvm::Value *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, llvm::Constant *Init) |
Emit 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 | completeTemplateDefinition (const ClassTemplateSpecializationDecl &SD) |
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 52 of file CGDebugInfo.h.
CGDebugInfo::CGDebugInfo | ( | CodeGenModule & | CGM | ) |
Definition at line 47 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::DebugPrefixMap, and clang::CodeGen::CodeGenModule::getCodeGenOpts().
CGDebugInfo::~CGDebugInfo | ( | ) |
Definition at line 56 of file CGDebugInfo.cpp.
void CGDebugInfo::completeClassData | ( | const RecordDecl * | RD | ) |
Definition at line 1611 of file CGDebugInfo.cpp.
References clang::Type::castAs(), clang::codegenoptions::DebugLineTablesOnly, clang::QualType::getAsOpaquePtr(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getRecordType(), and I.
Referenced by completeRequiredType(), and completeTemplateDefinition().
void CGDebugInfo::completeRequiredType | ( | const RecordDecl * | RD | ) |
Definition at line 1594 of file CGDebugInfo.cpp.
References completeClassData(), clang::codegenoptions::DebugLineTablesOnly, clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getRecordType(), and clang::CXXRecordDecl::isDynamicClass().
Referenced by completeType().
void CGDebugInfo::completeTemplateDefinition | ( | const ClassTemplateSpecializationDecl & | SD | ) |
Definition at line 2322 of file CGDebugInfo.cpp.
References completeClassData(), clang::codegenoptions::DebugLineTablesOnly, clang::QualType::getAsOpaquePtr(), clang::CodeGen::CodeGenModule::getContext(), and clang::ASTContext::getRecordType().
void CGDebugInfo::completeType | ( | const EnumDecl * | ED | ) |
Definition at line 1575 of file CGDebugInfo.cpp.
References clang::Type::castAs(), clang::codegenoptions::DebugLineTablesOnly, clang::QualType::getAsOpaquePtr(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getEnumType(), and I.
void CGDebugInfo::completeType | ( | const RecordDecl * | RD | ) |
Definition at line 1588 of file CGDebugInfo.cpp.
References completeRequiredType(), clang::CodeGen::CodeGenModule::getLangOpts(), and clang::codegenoptions::LimitedDebugInfo.
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 3324 of file CGDebugInfo.cpp.
References clang::codegenoptions::LimitedDebugInfo.
void CGDebugInfo::EmitDeclareOfAutoVariable | ( | const VarDecl * | Decl, |
llvm::Value * | AI, | ||
CGBuilderTy & | Builder | ||
) |
Emit call to llvm.dbg.declare
for an automatic variable declaration.
Definition at line 3239 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 3254 of file CGDebugInfo.cpp.
References clang::CharUnits::fromQuantity(), clang::CodeGen::CGBlockInfo::getCapture(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::CGBlockInfo::Capture::getIndex(), clang::NamedDecl::getName(), clang::CharUnits::getQuantity(), clang::ValueDecl::getType(), clang::codegenoptions::LimitedDebugInfo, Line, clang::CodeGen::CGBlockInfo::StructureType, and clang::ASTContext::toCharUnitsFromBits().
void CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable | ( | const CGBlockInfo & | block, |
llvm::Value * | Arg, | ||
unsigned | ArgNo, | ||
llvm::Value * | LocalAddr, | ||
CGBuilderTy & | Builder | ||
) |
Emit call to llvm.dbg.declare
for the block-literal argument to a block invocation function.
Definition at line 3341 of file CGDebugInfo.cpp.
References clang::TypeInfo::Align, clang::AS_public, clang::CodeGen::CGBlockInfo::BlockAlign, clang::CodeGen::CGBlockInfo::BlockSize, clang::BlockDecl::Capture::Capture(), clang::BlockDecl::captures(), clang::BlockDecl::capturesCXXThis(), clang::CodeGen::CGBlockInfo::CXXThisIndex, clang::CodeGen::CGBlockInfo::getBlockDecl(), clang::ASTContext::getBlockDescriptorExtendedType(), clang::ASTContext::getBlockDescriptorType(), clang::CodeGen::CGBlockInfo::getBlockExpr(), clang::CodeGen::CGBlockInfo::getCapture(), clang::BlockDecl::getCaretLocation(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::BlockExpr::getFunctionType(), clang::CodeGen::CGBlockInfo::Capture::getIndex(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::NamedDecl::getName(), clang::DeclContext::getParent(), clang::ASTContext::getPointerType(), clang::CXXMethodDecl::getThisType(), clang::ValueDecl::getType(), clang::ASTContext::getTypeInfo(), clang::CodeGen::CodeGenModule::getUniqueBlockCount(), clang::BlockDecl::Capture::getVariable(), clang::ASTContext::IntTy, clang::BlockDecl::Capture::isByRef(), clang::CodeGen::CGBlockInfo::Capture::isConstant(), clang::codegenoptions::LimitedDebugInfo, clang::CodeGen::CGBlockInfo::NeedsCopyDispose, clang::CodeGen::CodeGenTypeCache::PointerWidthInBits, clang::CodeGen::CGBlockInfo::StructureType, clang::ASTContext::toBits(), clang::ast_matchers::type, clang::ASTContext::VoidPtrTy, and clang::TypeInfo::Width.
void CGDebugInfo::EmitExplicitCastType | ( | QualType | Ty | ) |
Emit the type explicitly casted to.
Definition at line 3765 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), and clang::codegenoptions::LimitedDebugInfo.
void CGDebugInfo::EmitFunctionDecl | ( | GlobalDecl | GD, |
SourceLocation | Loc, | ||
QualType | FnType | ||
) |
Emit debug info for a function declaration.
Definition at line 2933 of file CGDebugInfo.cpp.
References clang::GlobalDecl::getDecl(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::SourceLocation::isInvalid(), and clang::Name.
void CGDebugInfo::EmitFunctionEnd | ( | CGBuilderTy & | Builder | ) |
Constructs the debug code for exiting a function.
Definition at line 3025 of file CGDebugInfo.cpp.
References EmitLocation().
void CGDebugInfo::EmitFunctionStart | ( | GlobalDecl | GD, |
SourceLocation | Loc, | ||
SourceLocation | ScopeLoc, | ||
QualType | FnType, | ||
llvm::Function * | Fn, | ||
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 2857 of file CGDebugInfo.cpp.
References clang::FunctionDecl::getCanonicalDecl(), clang::GlobalDecl::getDecl(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::SourceLocation::isInvalid(), and clang::Name.
void CGDebugInfo::EmitGlobalVariable | ( | llvm::GlobalVariable * | GV, |
const VarDecl * | Decl | ||
) |
Emit information about a global variable.
Definition at line 3532 of file CGDebugInfo.cpp.
References clang::Type::castAs(), clang::VarDecl::getCanonicalDecl(), clang::RecordDecl::isAnonymousStructOrUnion(), clang::Type::isUnionType(), and clang::codegenoptions::LimitedDebugInfo.
Referenced by clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().
void CGDebugInfo::EmitGlobalVariable | ( | const ValueDecl * | VD, |
llvm::Constant * | Init | ||
) |
Emit global variable's debug info.
Definition at line 3566 of file CGDebugInfo.cpp.
References clang::QualType::getAsOpaquePtr(), clang::CodeGen::CodeGenModule::getContext(), clang::NamedDecl::getName(), clang::ASTContext::getRecordType(), clang::ValueDecl::getType(), clang::TypeDecl::getTypeForDecl(), and clang::codegenoptions::LimitedDebugInfo.
void CGDebugInfo::EmitImportDecl | ( | const ImportDecl & | ID | ) |
Emit an declaration.
Definition at line 3657 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), and clang::ImportDecl::getImportedModule().
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 3012 of file CGDebugInfo.cpp.
References clang::codegenoptions::DebugLineTablesOnly, and 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 2996 of file CGDebugInfo.cpp.
References clang::codegenoptions::DebugLineTablesOnly, and 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 2975 of file CGDebugInfo.cpp.
References clang::SourceLocation::isInvalid(), clang::SourceLocation::isMacroID(), and setLocation().
Referenced by EmitFunctionEnd(), and EmitLexicalBlockEnd().
llvm::DIImportedEntity * CGDebugInfo::EmitNamespaceAlias | ( | const NamespaceAliasDecl & | NA | ) |
Emit C++ namespace alias.
Definition at line 3670 of file CGDebugInfo.cpp.
References clang::NamespaceAliasDecl::getAliasedNamespace(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::NamedDecl::getName(), and clang::codegenoptions::LimitedDebugInfo.
void CGDebugInfo::EmitUsingDecl | ( | const UsingDecl & | UD | ) |
Emit C++ using declaration.
Definition at line 3632 of file CGDebugInfo.cpp.
References clang::Type::getAs(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::ValueDecl::getType(), clang::codegenoptions::LimitedDebugInfo, clang::UsingDecl::shadow_begin(), and clang::UsingDecl::shadow_size().
void CGDebugInfo::EmitUsingDirective | ( | const UsingDirectiveDecl & | UD | ) |
Emit C++ using directive.
Definition at line 3619 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::UsingDirectiveDecl::getNominatedNamespace(), clang::NamespaceDecl::isAnonymousNamespace(), and clang::codegenoptions::LimitedDebugInfo.
void CGDebugInfo::finalize | ( | ) |
Definition at line 3715 of file CGDebugInfo.cpp.
llvm::DIType * CGDebugInfo::getOrCreateInterfaceType | ( | QualType | Ty, |
SourceLocation | Loc | ||
) |
Emit an Objective-C interface type standalone debug info.
Definition at line 1559 of file CGDebugInfo.cpp.
References getOrCreateStandaloneType().
llvm::DIType * CGDebugInfo::getOrCreateRecordType | ( | QualType | Ty, |
SourceLocation | L | ||
) |
Emit record type's standalone debug info.
Definition at line 1552 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 1564 of file CGDebugInfo.cpp.
References clang::QualType::getAsOpaquePtr(), clang::QualType::isNull(), and clang::codegenoptions::LimitedDebugInfo.
Referenced by getOrCreateInterfaceType().
void CGDebugInfo::setDwoId | ( | uint64_t | Signature | ) |
Module debugging: Support for building PCMs.
Set the main CU's DwoId field to Signature
.
Definition at line 3709 of file CGDebugInfo.cpp.
void CGDebugInfo::setLocation | ( | SourceLocation | Loc | ) |
Update the current source location.
If
Definition at line 122 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getContext(), clang::SourceManager::getExpansionLoc(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getSourceManager(), clang::SourceLocation::isInvalid(), and SM.
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 284 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 289 of file CGDebugInfo.h.
|
friend |
Definition at line 53 of file CGDebugInfo.h.
|
friend |
Definition at line 54 of file CGDebugInfo.h.