clang API Documentation
#include <CGDebugInfo.h>
Public Member Functions | |
| CGDebugInfo (CodeGenModule &CGM) | |
| ~CGDebugInfo () | |
| void | finalize (void) |
| void | setLocation (SourceLocation Loc) |
| void | EmitLocation (CGBuilderTy &Builder, SourceLocation Loc) |
| void | EmitFunctionStart (GlobalDecl GD, 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 *addr, CGBuilderTy &Builder) |
| void | EmitGlobalVariable (llvm::GlobalVariable *GV, const VarDecl *Decl) |
| EmitGlobalVariable - Emit information about a global variable. | |
| void | EmitGlobalVariable (llvm::GlobalVariable *GV, ObjCInterfaceDecl *Decl) |
| EmitGlobalVariable - Emit information about an objective-c interface. | |
| void | EmitGlobalVariable (const ValueDecl *VD, llvm::Constant *Init) |
| EmitGlobalVariable - Emit global variable's debug info. | |
| llvm::DIType | getOrCreateRecordType (QualType Ty, SourceLocation L) |
| getOrCreateRecordType - Emit record type's standalone debug info. | |
| llvm::DIType | getOrCreateInterfaceType (QualType Ty, SourceLocation Loc) |
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 46 of file CGDebugInfo.h.
| CGDebugInfo::CGDebugInfo | ( | CodeGenModule & | CGM | ) |
Definition at line 41 of file CGDebugInfo.cpp.
| CGDebugInfo::~CGDebugInfo | ( | ) |
Definition at line 47 of file CGDebugInfo.cpp.
| 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 2422 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::DebugInfo, clang::CodeGen::CodeGenModule::getCodeGenOpts(), and 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 2354 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::DebugInfo, clang::CodeGen::CodeGenModule::getCodeGenOpts(), and 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 2361 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::DebugInfo, clang::CharUnits::fromQuantity(), clang::CodeGen::CGBlockInfo::getCapture(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getContext(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::CharUnits::getQuantity(), clang::CodeGen::CodeGenModule::getTargetData(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::CodeGenOptions::LimitedDebugInfo, clang::CodeGen::CGBlockInfo::StructureType, and clang::ASTContext::toCharUnitsFromBits().
| void CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable | ( | const CGBlockInfo & | block, |
| llvm::Value * | addr, | ||
| CGBuilderTy & | Builder | ||
| ) |
EmitDeclareOfBlockLiteralArgVariable - Emit call to llvm.dbg.declare for the block-literal argument to a block invocation function.
Definition at line 2439 of file CGDebugInfo.cpp.
References clang::AS_public, clang::CodeGen::CGBlockInfo::BlockAlign, clang::CodeGen::CGBlockInfo::BlockSize, clang::BlockDecl::Capture::Capture(), clang::BlockDecl::capture_begin(), clang::BlockDecl::capture_end(), clang::BlockDecl::capturesCXXThis(), clang::CodeGen::CGBlockInfo::CXXThisIndex, clang::CodeGenOptions::DebugInfo, clang::CodeGen::CGBlockInfo::getBlockDecl(), clang::CodeGen::CGBlockInfo::getCapture(), clang::BlockDecl::getCaretLocation(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getContext(), clang::Decl::getDeclContext(), clang::CodeGen::CGBlockInfo::Capture::getIndex(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::NamedDecl::getName(), clang::Decl::getNonClosureContext(), clang::CodeGen::CodeGenModule::getTargetData(), clang::CXXMethodDecl::getThisType(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getUniqueBlockCount(), clang::BlockDecl::Capture::getVariable(), clang::BlockDecl::Capture::isByRef(), clang::CodeGen::CGBlockInfo::Capture::isConstant(), clang::CodeGenOptions::LimitedDebugInfo, clang::CodeGen::CGBlockInfo::NeedsCopyDispose, clang::CodeGen::CodeGenTypeCache::PointerWidthInBits, clang::CodeGen::CGBlockInfo::StructureType, and clang::ASTContext::toBits().
| void CGDebugInfo::EmitFunctionEnd | ( | CGBuilderTy & | Builder | ) |
EmitFunctionEnd - Constructs the debug code for exiting a function.
Definition at line 2140 of file CGDebugInfo.cpp.
References EmitLexicalBlockEnd().
| void CGDebugInfo::EmitFunctionStart | ( | GlobalDecl | GD, |
| 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.
Definition at line 1979 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::DebugInfo, clang::CodeGenOptions::DebugLineTablesOnly, clang::FunctionDecl::getCanonicalDecl(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::GlobalDecl::getDecl(), clang::Decl::getDeclContext(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::Decl::getLocation(), clang::CodeGen::CodeGenModule::getMangledName(), clang::FunctionDecl::hasPrototype(), clang::Decl::isImplicit(), and clang::CodeGenOptions::LimitedDebugInfo.
| void CGDebugInfo::EmitGlobalVariable | ( | llvm::GlobalVariable * | GV, |
| const VarDecl * | Decl | ||
| ) |
EmitGlobalVariable - Emit information about a global variable.
Definition at line 2585 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::DebugInfo, clang::ASTContext::getAsArrayType(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::ASTContext::getConstantArrayType(), clang::CodeGen::CodeGenModule::getContext(), clang::Decl::getDeclContext(), clang::ArrayType::getElementType(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::ValueDecl::getType(), clang::CodeGenOptions::LimitedDebugInfo, and setLocation().
Referenced by clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().
| void CGDebugInfo::EmitGlobalVariable | ( | llvm::GlobalVariable * | GV, |
| ObjCInterfaceDecl * | Decl | ||
| ) |
EmitGlobalVariable - Emit information about an objective-c interface.
Definition at line 2621 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::DebugInfo, clang::ASTContext::getAsArrayType(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::ASTContext::getConstantArrayType(), clang::CodeGen::CodeGenModule::getContext(), clang::ArrayType::getElementType(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::ASTContext::getObjCInterfaceType(), and clang::CodeGenOptions::LimitedDebugInfo.
| void CGDebugInfo::EmitGlobalVariable | ( | const ValueDecl * | VD, |
| llvm::Constant * | Init | ||
| ) |
EmitGlobalVariable - Emit global variable's debug info.
Definition at line 2649 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::DebugInfo, clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::ValueDecl::getType(), 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 2130 of file CGDebugInfo.cpp.
References EmitLocation().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXForRangeStmt(), clang::CodeGen::CodeGenFunction::EmitForStmt(), EmitFunctionEnd(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolStmt(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), and clang::CodeGen::CodeGenFunction::LexicalScope::~LexicalScope().
| 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 2115 of file CGDebugInfo.cpp.
References setLocation().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXForRangeStmt(), clang::CodeGen::CodeGenFunction::EmitForStmt(), clang::CodeGen::CodeGenFunction::EmitObjCAutoreleasePoolStmt(), and clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt().
| void CGDebugInfo::EmitLocation | ( | CGBuilderTy & | Builder, |
| SourceLocation | Loc | ||
| ) |
EmitLocation - Emit metadata to indicate a change in line/column information in the source file.
Definition at line 2075 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getContext(), clang::SourceManager::getExpansionLoc(), clang::ASTContext::getSourceManager(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isMacroID(), and setLocation().
Referenced by EmitLexicalBlockEnd().
| void CGDebugInfo::finalize | ( | void | ) |
Definition at line 2687 of file CGDebugInfo.cpp.
Referenced by clang::CodeGen::CodeGenModule::Release().
| llvm::DIType CGDebugInfo::getOrCreateInterfaceType | ( | QualType | D, |
| SourceLocation | Loc | ||
| ) |
getOrCreateInterfaceType - Emit an objective c interface type standalone debug info.
Definition at line 1186 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::DebugInfo, clang::CodeGen::CodeGenModule::getCodeGenOpts(), and clang::CodeGenOptions::LimitedDebugInfo.
| llvm::DIType CGDebugInfo::getOrCreateRecordType | ( | QualType | Ty, |
| SourceLocation | L | ||
| ) |
getOrCreateRecordType - Emit record type's standalone debug info.
Definition at line 1177 of file CGDebugInfo.cpp.
References clang::CodeGenOptions::DebugInfo, clang::CodeGen::CodeGenModule::getCodeGenOpts(), and clang::CodeGenOptions::LimitedDebugInfo.
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall().
| void CGDebugInfo::setLocation | ( | SourceLocation | Loc | ) |
setLocation - Update the current source location. If
Definition at line 52 of file CGDebugInfo.cpp.
References clang::CodeGen::CodeGenModule::getContext(), clang::SourceManager::getExpansionLoc(), clang::PresumedLoc::getFilename(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getSourceManager(), clang::PresumedLoc::isInvalid(), and clang::SourceLocation::isValid().
Referenced by EmitGlobalVariable(), EmitLexicalBlockStart(), EmitLocation(), and clang::CodeGen::CodeGenFunction::EmitStaticVarDecl().