clang API Documentation
#include <CGDebugInfo.h>
Classes | |
struct | ObjCInterfaceCacheEntry |
Public Member Functions | |
CGDebugInfo (CodeGenModule &CGM) | |
~CGDebugInfo () | |
void | finalize () |
void | setLocation (SourceLocation Loc) |
SourceLocation | getLocation () const |
getLocation - Return the current source location. | |
void | EmitLocation (CGBuilderTy &Builder, SourceLocation Loc, bool ForceColumnInfo=false) |
void | EmitFunctionStart (GlobalDecl GD, SourceLocation Loc, SourceLocation ScopeLoc, QualType FnType, llvm::Function *Fn, CGBuilderTy &Builder) |
EmitFunctionStart - Constructs the debug code for entering a function. | |
void | EmitFunctionEnd (CGBuilderTy &Builder) |
EmitFunctionEnd - Constructs the debug code for exiting a function. | |
void | EmitLexicalBlockStart (CGBuilderTy &Builder, SourceLocation Loc) |
void | EmitLexicalBlockEnd (CGBuilderTy &Builder, SourceLocation Loc) |
void | EmitDeclareOfAutoVariable (const VarDecl *Decl, llvm::Value *AI, CGBuilderTy &Builder) |
void | EmitDeclareOfBlockDeclRefVariable (const VarDecl *variable, llvm::Value *storage, CGBuilderTy &Builder, const CGBlockInfo &blockInfo) |
void | EmitDeclareOfArgVariable (const VarDecl *Decl, llvm::Value *AI, unsigned ArgNo, CGBuilderTy &Builder) |
void | EmitDeclareOfBlockLiteralArgVariable (const CGBlockInfo &block, llvm::Value *Arg, unsigned ArgNo, llvm::Value *LocalAddr, CGBuilderTy &Builder) |
void | EmitGlobalVariable (llvm::GlobalVariable *GV, const VarDecl *Decl) |
EmitGlobalVariable - Emit information about a global variable. | |
void | EmitGlobalVariable (const ValueDecl *VD, llvm::Constant *Init) |
EmitGlobalVariable - Emit global variable's debug info. | |
void | EmitUsingDirective (const UsingDirectiveDecl &UD) |
| |
void | EmitExplicitCastType (QualType Ty) |
EmitExplicitCastType - Emit the type explicitly casted to. | |
void | EmitUsingDecl (const UsingDecl &UD) |
| |
llvm::DIImportedEntity | EmitNamespaceAlias (const NamespaceAliasDecl &NA) |
| |
llvm::DIType | getOrCreateRecordType (QualType Ty, SourceLocation L) |
getOrCreateRecordType - Emit record type's standalone debug info. | |
llvm::DIType | getOrCreateInterfaceType (QualType Ty, SourceLocation Loc) |
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) |
Friends | |
class | ArtificialLocation |
class | SaveAndRestoreLocation |
CGDebugInfo - 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 49 of file CGDebugInfo.h.
CGDebugInfo::CGDebugInfo | ( | CodeGenModule & | CGM | ) |
Definition at line 44 of file CGDebugInfo.cpp.
Definition at line 50 of file CGDebugInfo.cpp.
void CGDebugInfo::completeClassData | ( | const RecordDecl * | RD | ) |
Definition at line 1478 of file CGDebugInfo.cpp.
References clang::Type::castAs(), clang::CodeGenOptions::DebugLineTablesOnly, clang::QualType::getAsOpaquePtr(), clang::CodeGen::CodeGenModule::getContext(), and clang::ASTContext::getRecordType().
Referenced by completeRequiredType(), and completeTemplateDefinition().
void CGDebugInfo::completeRequiredType | ( | const RecordDecl * | RD | ) |
Definition at line 1464 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 2049 of file CGDebugInfo.cpp.
References completeClassData(), clang::CodeGenOptions::DebugLineTablesOnly, clang::QualType::getAsOpaquePtr(), clang::CodeGen::CodeGenModule::getContext(), and clang::ASTContext::getRecordType().
Referenced by clang::CodeGen::CodeGenModule::EmitTopLevelDecl().
void CGDebugInfo::completeType | ( | const EnumDecl * | ED | ) |
Definition at line 1443 of file CGDebugInfo.cpp.
References clang::Type::castAs(), clang::CodeGenOptions::DebugLineTablesOnly, clang::QualType::getAsOpaquePtr(), clang::CodeGen::CodeGenModule::getContext(), and clang::ASTContext::getEnumType().
void CGDebugInfo::completeType | ( | const RecordDecl * | RD | ) |
Definition at line 1458 of file CGDebugInfo.cpp.
References completeRequiredType(), clang::CodeGen::CodeGenModule::getLangOpts(), and clang::CodeGenOptions::LimitedDebugInfo.
void CGDebugInfo::EmitDeclareOfArgVariable | ( | const VarDecl * | VD, |
llvm::Value * | AI, | ||
unsigned | ArgNo, | ||
CGBuilderTy & | Builder | ||
) |
EmitDeclareOfArgVariable - Emit call to llvm.dbg.declare for an argument variable declaration.
Definition at line 3009 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::LimitedDebugInfo.
void CGDebugInfo::EmitDeclareOfAutoVariable | ( | const VarDecl * | Decl, |
llvm::Value * | AI, | ||
CGBuilderTy & | Builder | ||
) |
EmitDeclareOfAutoVariable - Emit call to llvm.dbg.declare for an automatic variable declaration.
Definition at line 2920 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::LimitedDebugInfo.
void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable | ( | const VarDecl * | variable, |
llvm::Value * | storage, | ||
CGBuilderTy & | Builder, | ||
const CGBlockInfo & | blockInfo | ||
) |
EmitDeclareOfBlockDeclRefVariable - Emit call to llvm.dbg.declare for an imported variable declaration in a block.
Definition at line 2941 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::Decl::getLocation(), clang::NamedDecl::getName(), clang::CharUnits::getQuantity(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), 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 | ||
) |
EmitDeclareOfBlockLiteralArgVariable - Emit call to llvm.dbg.declare for the block-literal argument to a block invocation function.
Definition at line 3026 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::Decl::getDeclContext(), clang::BlockExpr::getFunctionType(), clang::CodeGen::CGBlockInfo::Capture::getIndex(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::NamedDecl::getName(), clang::Decl::getNonClosureContext(), 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 | ) |
EmitExplicitCastType - Emit the type explicitly casted to.
Definition at line 3414 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), and clang::CodeGenOptions::LimitedDebugInfo.
void CGDebugInfo::EmitFunctionEnd | ( | CGBuilderTy & | Builder | ) |
EmitFunctionEnd - Constructs the debug code for exiting a function.
Definition at line 2716 of file CGDebugInfo.cpp.
References EmitLocation().
void CGDebugInfo::EmitFunctionStart | ( | GlobalDecl | GD, |
SourceLocation | Loc, | ||
SourceLocation | ScopeLoc, | ||
QualType | FnType, | ||
llvm::Function * | Fn, | ||
CGBuilderTy & | Builder | ||
) |
EmitFunctionStart - Constructs the debug code for entering a function.
EmitFunctionStart - 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 2563 of file CGDebugInfo.cpp.
References clang::Decl::getCanonicalDecl(), clang::FunctionDecl::getCanonicalDecl(), clang::GlobalDecl::getDecl(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::Decl::isImplicit(), and clang::SourceLocation::isInvalid().
void CGDebugInfo::EmitGlobalVariable | ( | llvm::GlobalVariable * | GV, |
const VarDecl * | Decl | ||
) |
EmitGlobalVariable - Emit information about a global variable.
Definition at line 3226 of file CGDebugInfo.cpp.
References 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 | ||
) |
EmitGlobalVariable - Emit global variable's debug info.
Definition at line 3259 of file CGDebugInfo.cpp.
References clang::Decl::getCanonicalDecl(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::ValueDecl::getType(), clang::TypeDecl::getTypeForDecl(), and clang::CodeGenOptions::LimitedDebugInfo.
void CGDebugInfo::EmitLexicalBlockEnd | ( | CGBuilderTy & | Builder, |
SourceLocation | Loc | ||
) |
EmitLexicalBlockEnd - Emit metadata to indicate the end of a new lexical block and pop the current block.
EmitLexicalBlockEnd - Constructs the debug code for exiting a declarative region - end of a DW_TAG_lexical_block.
Definition at line 2702 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::DebugLineTablesOnly, and EmitLocation().
Referenced by clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolStmt(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), and clang::CodeGen::CodeGenFunction::EmitOMPSimdDirective().
void CGDebugInfo::EmitLexicalBlockStart | ( | CGBuilderTy & | Builder, |
SourceLocation | Loc | ||
) |
EmitLexicalBlockStart - Emit metadata to indicate the beginning of a new lexical block and push the block onto the stack.
EmitLexicalBlockStart - Constructs the debug code for entering a declarative region - beginning of a DW_TAG_lexical_block.
Definition at line 2684 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::DebugLineTablesOnly, and setLocation().
Referenced by clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolStmt(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), and clang::CodeGen::CodeGenFunction::EmitOMPSimdDirective().
void CGDebugInfo::EmitLocation | ( | CGBuilderTy & | Builder, |
SourceLocation | Loc, | ||
bool | ForceColumnInfo = false |
||
) |
EmitLocation - Emit metadata to indicate a change in line/column information in the source file.
ForceColumnInfo | Assume DebugColumnInfo option is true. |
EmitLocation - 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 2645 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getContext(), clang::SourceManager::getExpansionLoc(), clang::CodeGen::CodeGenModule::getLLVMContext(), clang::ASTContext::getSourceManager(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isMacroID(), and setLocation().
Referenced by clang::CodeGen::ArtificialLocation::Emit(), clang::CodeGen::CodeGenFunction::EmitCallArgs(), EmitFunctionEnd(), EmitLexicalBlockEnd(), clang::CodeGen::CodeGenFunction::PopCleanupBlock(), and clang::CodeGen::SaveAndRestoreLocation::~SaveAndRestoreLocation().
llvm::DIImportedEntity CGDebugInfo::EmitNamespaceAlias | ( | const NamespaceAliasDecl & | NA | ) |
Definition at line 3321 of file CGDebugInfo.cpp.
References clang::NamespaceAliasDecl::getAliasedNamespace(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::NamedDecl::getName(), and clang::CodeGenOptions::LimitedDebugInfo.
void CGDebugInfo::EmitUsingDecl | ( | const UsingDecl & | UD | ) |
Definition at line 3305 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGenOptions::LimitedDebugInfo, clang::UsingDecl::shadow_begin(), and clang::UsingDecl::shadow_size().
void CGDebugInfo::EmitUsingDirective | ( | const UsingDirectiveDecl & | UD | ) |
Definition at line 3296 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::UsingDirectiveDecl::getNominatedNamespace(), and clang::CodeGenOptions::LimitedDebugInfo.
void CGDebugInfo::finalize | ( | ) |
Definition at line 3364 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getLLVMContext().
Referenced by clang::CodeGen::CodeGenModule::Release().
SourceLocation clang::CodeGen::CGDebugInfo::getLocation | ( | ) | const [inline] |
getLocation - Return the current source location.
Definition at line 228 of file CGDebugInfo.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitCallArgs(), and clang::CodeGen::SaveAndRestoreLocation::SaveAndRestoreLocation().
llvm::DIType CGDebugInfo::getOrCreateInterfaceType | ( | QualType | D, |
SourceLocation | Loc | ||
) |
getOrCreateInterfaceType - Emit an objective c interface type standalone debug info.
Definition at line 1435 of file CGDebugInfo.cpp.
References clang::QualType::getAsOpaquePtr(), and clang::CodeGenOptions::LimitedDebugInfo.
llvm::DIType CGDebugInfo::getOrCreateRecordType | ( | QualType | Ty, |
SourceLocation | L | ||
) |
getOrCreateRecordType - Emit record type's standalone debug info.
Definition at line 1426 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::LimitedDebugInfo.
void CGDebugInfo::setLocation | ( | SourceLocation | Loc | ) |
setLocation - Update the current source location. If
Definition at line 103 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().
friend class ArtificialLocation [friend] |
Definition at line 50 of file CGDebugInfo.h.
friend class SaveAndRestoreLocation [friend] |
Definition at line 51 of file CGDebugInfo.h.