13#ifndef LLVM_CLANG_LIB_CODEGEN_CGDEBUGINFO_H
14#define LLVM_CLANG_LIB_CODEGEN_CGDEBUGINFO_H
26#include "llvm/ADT/DenseMap.h"
27#include "llvm/ADT/DenseSet.h"
28#include "llvm/IR/DIBuilder.h"
29#include "llvm/IR/DebugInfo.h"
30#include "llvm/IR/ValueHandle.h"
31#include "llvm/Support/Allocator.h"
41class ClassTemplateSpecializationDecl;
45class ObjCInterfaceDecl;
62 const llvm::codegenoptions::DebugInfoKind DebugKind;
63 bool DebugTypeExtRefs;
64 llvm::DIBuilder DBuilder;
65 llvm::DICompileUnit *TheCU =
nullptr;
69 llvm::MDNode *CurInlinedAt =
nullptr;
70 llvm::DIType *VTablePtrType =
nullptr;
71 llvm::DIType *ClassTy =
nullptr;
72 llvm::DICompositeType *ObjTy =
nullptr;
73 llvm::DIType *SelTy =
nullptr;
74#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
75 llvm::DIType *SingletonId = nullptr;
76#include "clang/Basic/OpenCLImageTypes.def"
77 llvm::DIType *OCLSamplerDITy =
nullptr;
78 llvm::DIType *OCLEventDITy =
nullptr;
79 llvm::DIType *OCLClkEventDITy =
nullptr;
80 llvm::DIType *OCLQueueDITy =
nullptr;
81 llvm::DIType *OCLNDRangeDITy =
nullptr;
82 llvm::DIType *OCLReserveIDDITy =
nullptr;
83#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
84 llvm::DIType *Id##Ty = nullptr;
85#include "clang/Basic/OpenCLExtensionTypes.def"
86#define WASM_TYPE(Name, Id, SingletonId) llvm::DIType *SingletonId = nullptr;
87#include "clang/Basic/WebAssemblyReferenceTypes.def"
88#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) \
89 llvm::DIType *SingletonId = nullptr;
90#include "clang/Basic/AMDGPUTypes.def"
91#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) \
92 llvm::DIType *SingletonId = nullptr;
93#include "clang/Basic/HLSLIntangibleTypes.def"
96 llvm::DenseMap<const void *, llvm::TrackingMDRef> TypeCache;
100 llvm::SmallDenseMap<QualType, llvm::Metadata *> SizeExprCache;
104 const CGDebugInfo &Self;
107 PrintingCallbacks(
const CGDebugInfo &Self) : Self(Self) {}
108 std::string remapPath(StringRef
Path)
const override {
109 return Self.remapDIPath(
Path);
112 PrintingCallbacks PrintCB = {*
this};
114 struct ObjCInterfaceCacheEntry {
115 const ObjCInterfaceType *
Type;
118 ObjCInterfaceCacheEntry(
const ObjCInterfaceType *Type, llvm::DIType *Decl,
129 llvm::DenseMap<
const ObjCInterfaceDecl *,
130 std::vector<llvm::PointerIntPair<llvm::DISubprogram *, 1>>>
134 llvm::DenseMap<const Module *, llvm::TrackingMDRef> ModuleCache;
137 std::vector<void *> RetainedTypes;
140 std::vector<std::pair<const TagType *, llvm::TrackingMDRef>> ReplaceMap;
144 std::vector<std::pair<const DeclaratorDecl *, llvm::TrackingMDRef>>
148 std::vector<llvm::TypedTrackingMDRef<llvm::DIScope>> LexicalBlockStack;
149 llvm::DenseMap<const Decl *, llvm::TrackingMDRef> RegionMap;
153 std::vector<unsigned> FnBeginRegionCount;
157 llvm::BumpPtrAllocator DebugInfoNames;
160 llvm::DenseMap<const char *, llvm::TrackingMDRef> DIFileCache;
161 llvm::DenseMap<const FunctionDecl *, llvm::TrackingMDRef> SPCache;
165 llvm::DenseMap<const Decl *, llvm::TrackingMDRef> DeclCache;
166 llvm::DenseMap<const Decl *, llvm::TrackingMDRef> ImportedDeclCache;
167 llvm::DenseMap<const NamespaceDecl *, llvm::TrackingMDRef> NamespaceCache;
168 llvm::DenseMap<const NamespaceAliasDecl *, llvm::TrackingMDRef>
170 llvm::DenseMap<const Decl *, llvm::TypedTrackingMDRef<llvm::DIDerivedType>>
171 StaticDataMemberCache;
173 using ParamDecl2StmtTy = llvm::DenseMap<const ParmVarDecl *, const Stmt *>;
174 using Param2DILocTy =
175 llvm::DenseMap<const ParmVarDecl *, llvm::DILocalVariable *>;
178 ParamDecl2StmtTy CoroutineParameterMappings;
180 Param2DILocTy ParamDbgMappings;
186 llvm::DIType *CreateType(
const BuiltinType *Ty);
187 llvm::DIType *CreateType(
const ComplexType *Ty);
188 llvm::DIType *CreateType(
const BitIntType *Ty);
189 llvm::DIType *CreateQualifiedType(QualType Ty, llvm::DIFile *Fg);
190 llvm::DIType *CreateQualifiedType(
const FunctionProtoType *Ty,
192 llvm::DIType *CreateType(
const TypedefType *Ty, llvm::DIFile *Fg);
193 llvm::DIType *CreateType(
const TemplateSpecializationType *Ty,
195 llvm::DIType *CreateType(
const ObjCObjectPointerType *Ty, llvm::DIFile *F);
196 llvm::DIType *CreateType(
const PointerType *Ty, llvm::DIFile *F);
197 llvm::DIType *CreateType(
const BlockPointerType *Ty, llvm::DIFile *F);
198 llvm::DIType *CreateType(
const FunctionType *Ty, llvm::DIFile *F);
199 llvm::DIType *CreateType(
const HLSLAttributedResourceType *Ty,
202 llvm::DIType *CreateType(
const RecordType *Tyg);
210 std::pair<llvm::DIType *, llvm::DIType *>
211 CreateTypeDefinition(
const RecordType *Ty);
212 llvm::DICompositeType *CreateLimitedType(
const RecordType *Ty);
213 void CollectContainingType(
const CXXRecordDecl *RD,
214 llvm::DICompositeType *CT);
216 llvm::DIType *CreateType(
const ObjCInterfaceType *Ty, llvm::DIFile *F);
217 llvm::DIType *CreateTypeDefinition(
const ObjCInterfaceType *Ty,
220 llvm::DIType *CreateType(
const ObjCObjectType *Ty, llvm::DIFile *F);
221 llvm::DIType *CreateType(
const ObjCTypeParamType *Ty, llvm::DIFile *Unit);
223 llvm::DIType *CreateType(
const VectorType *Ty, llvm::DIFile *F);
224 llvm::DIType *CreateType(
const ConstantMatrixType *Ty, llvm::DIFile *F);
225 llvm::DIType *CreateType(
const ArrayType *Ty, llvm::DIFile *F);
226 llvm::DIType *CreateType(
const LValueReferenceType *Ty, llvm::DIFile *F);
227 llvm::DIType *CreateType(
const RValueReferenceType *Ty, llvm::DIFile *Unit);
228 llvm::DIType *CreateType(
const MemberPointerType *Ty, llvm::DIFile *F);
229 llvm::DIType *CreateType(
const AtomicType *Ty, llvm::DIFile *F);
230 llvm::DIType *CreateType(
const PipeType *Ty, llvm::DIFile *F);
232 llvm::DIType *CreateEnumType(
const EnumType *Ty);
233 llvm::DIType *CreateTypeDefinition(
const EnumType *Ty);
240 llvm::DIType *CreateSelfType(
const QualType &QualTy, llvm::DIType *Ty);
245 llvm::DIType *getTypeOrNull(
const QualType);
250 llvm::DISubroutineType *getOrCreateMethodType(
const CXXMethodDecl *Method,
252 llvm::DISubroutineType *
253 getOrCreateInstanceMethodType(QualType ThisPtr,
const FunctionProtoType *
Func,
255 llvm::DISubroutineType *
256 getOrCreateFunctionType(
const Decl *
D, QualType FnType, llvm::DIFile *F);
258 llvm::DIType *getOrCreateVTablePtrType(llvm::DIFile *F);
261 llvm::DINamespace *getOrCreateNamespace(
const NamespaceDecl *N);
262 llvm::DIType *CreatePointerLikeType(llvm::dwarf::Tag Tag,
const Type *Ty,
263 QualType PointeeTy, llvm::DIFile *F);
264 llvm::DIType *getOrCreateStructPtrType(StringRef Name, llvm::DIType *&
Cache);
268 llvm::DISubprogram *CreateCXXMemberFunction(
const CXXMethodDecl *Method,
270 llvm::DIType *RecordTy);
275 void CollectCXXMemberFunctions(
const CXXRecordDecl *
Decl, llvm::DIFile *F,
276 SmallVectorImpl<llvm::Metadata *> &
E,
282 void CollectCXXBases(
const CXXRecordDecl *
Decl, llvm::DIFile *F,
283 SmallVectorImpl<llvm::Metadata *> &EltTys,
284 llvm::DIType *RecordTy);
288 void CollectCXXBasesAux(
289 const CXXRecordDecl *RD, llvm::DIFile *Unit,
290 SmallVectorImpl<llvm::Metadata *> &EltTys, llvm::DIType *RecordTy,
292 llvm::DenseSet<CanonicalDeclPtr<const CXXRecordDecl>> &SeenTypes,
293 llvm::DINode::DIFlags StartingFlags);
298 llvm::DIType *GetPreferredNameType(
const CXXRecordDecl *RD,
301 struct TemplateArgs {
302 const TemplateParameterList *TList;
306 llvm::DINodeArray CollectTemplateParams(std::optional<TemplateArgs> Args,
310 llvm::DINodeArray CollectFunctionTemplateParams(
const FunctionDecl *FD,
315 llvm::DINodeArray CollectVarTemplateParams(
const VarDecl *VD,
318 std::optional<TemplateArgs> GetTemplateArgs(
const VarDecl *)
const;
319 std::optional<TemplateArgs> GetTemplateArgs(
const RecordDecl *)
const;
320 std::optional<TemplateArgs> GetTemplateArgs(
const FunctionDecl *)
const;
324 llvm::DINodeArray CollectCXXTemplateParams(
const RecordDecl *TS,
328 llvm::DINodeArray CollectBTFDeclTagAnnotations(
const Decl *
D);
330 llvm::DIType *createFieldType(StringRef name, QualType
type,
332 uint64_t offsetInBits, uint32_t AlignInBits,
333 llvm::DIFile *tunit, llvm::DIScope *scope,
334 const RecordDecl *RD =
nullptr,
335 llvm::DINodeArray Annotations =
nullptr);
337 llvm::DIType *createFieldType(StringRef name, QualType
type,
339 uint64_t offsetInBits, llvm::DIFile *tunit,
340 llvm::DIScope *scope,
341 const RecordDecl *RD =
nullptr) {
342 return createFieldType(name,
type, loc, AS, offsetInBits, 0, tunit, scope,
347 llvm::DIDerivedType *createBitFieldType(
const FieldDecl *BitFieldDecl,
348 llvm::DIScope *RecordTy,
349 const RecordDecl *RD);
353 llvm::DIDerivedType *createBitFieldSeparatorIfNeeded(
354 const FieldDecl *BitFieldDecl,
const llvm::DIDerivedType *BitFieldDI,
358 llvm::StringMap<llvm::DISubprogram *> InlinedTrapFuncMap;
362 llvm::DISubprogram *createInlinedTrapSubprogram(StringRef FuncName,
363 llvm::DIFile *FileScope);
367 void CollectRecordLambdaFields(
const CXXRecordDecl *CXXDecl,
368 SmallVectorImpl<llvm::Metadata *> &
E,
369 llvm::DIType *RecordTy);
370 llvm::DIDerivedType *CreateRecordStaticField(
const VarDecl *Var,
371 llvm::DIType *RecordTy,
372 const RecordDecl *RD);
373 void CollectRecordNormalField(
const FieldDecl *Field, uint64_t OffsetInBits,
375 SmallVectorImpl<llvm::Metadata *> &
E,
376 llvm::DIType *RecordTy,
const RecordDecl *RD);
377 void CollectRecordNestedType(
const TypeDecl *RD,
378 SmallVectorImpl<llvm::Metadata *> &
E);
379 void CollectRecordFields(
const RecordDecl *
Decl, llvm::DIFile *F,
380 SmallVectorImpl<llvm::Metadata *> &
E,
381 llvm::DICompositeType *RecordTy);
385 void CollectVTableInfo(
const CXXRecordDecl *
Decl, llvm::DIFile *F,
386 SmallVectorImpl<llvm::Metadata *> &EltTys);
390 void CreateLexicalBlock(SourceLocation
Loc);
398 void AppendAddressSpaceXDeref(
unsigned AddressSpace,
399 SmallVectorImpl<uint64_t> &Expr)
const;
405 uint64_t collectDefaultElementTypesForBlockPointer(
406 const BlockPointerType *Ty, llvm::DIFile *Unit,
407 llvm::DIDerivedType *DescTy,
unsigned LineNo,
408 SmallVectorImpl<llvm::Metadata *> &EltTys);
412 void collectDefaultFieldsForBlockLiteralDeclare(
413 const CGBlockInfo &
Block,
const ASTContext &Context, SourceLocation
Loc,
414 const llvm::StructLayout &BlockLayout, llvm::DIFile *Unit,
415 SmallVectorImpl<llvm::Metadata *> &Fields);
428 SizeExprCache[Ty] = SizeExpr;
457 void setInlinedAt(llvm::MDNode *InlinedAt) { CurInlinedAt = InlinedAt; }
479 llvm::Function *Fn,
bool CurFnIsThunk);
489 QualType FnType, llvm::Function *Fn =
nullptr);
512 llvm::DILocalVariable *
515 const bool UsePointerValue =
false);
524 const CGBlockInfo &blockInfo, llvm::Instruction *InsertPoint =
nullptr);
528 llvm::DILocalVariable *
530 CGBuilderTy &Builder,
bool UsePointerValue =
false);
535 StringRef Name,
unsigned ArgNo,
536 llvm::AllocaInst *LocalAddr,
624 return CoroutineParameterMappings;
637 StringRef FailureMsg);
643 llvm::DILocalVariable *EmitDeclare(
const VarDecl *
decl, llvm::Value *AI,
644 std::optional<unsigned> ArgNo,
646 const bool UsePointerValue =
false);
651 llvm::DILocalVariable *EmitDeclare(
const BindingDecl *
decl, llvm::Value *AI,
652 std::optional<unsigned> ArgNo,
654 const bool UsePointerValue =
false);
656 struct BlockByRefType {
658 llvm::DIType *BlockByRefWrapper;
660 llvm::DIType *WrappedType;
664 std::string GetName(
const Decl *,
bool Qualified =
false)
const;
667 BlockByRefType EmitTypeForVarWithBlocksAttr(
const VarDecl *VD,
671 llvm::DIScope *getDeclContextDescriptor(
const Decl *
D);
673 llvm::DIScope *getContextDescriptor(
const Decl *Context,
676 llvm::DIScope *getCurrentContextDescriptor(
const Decl *
Decl);
679 llvm::DICompositeType *getOrCreateRecordFwdDecl(
const RecordType *,
683 StringRef getCurrentDirname();
686 void CreateCompileUnit();
689 std::optional<llvm::DIFile::ChecksumKind>
702 std::optional<llvm::DIFile::ChecksumInfo<StringRef>> CSInfo,
703 std::optional<StringRef> Source);
706 llvm::DIType *getOrCreateType(
QualType Ty, llvm::DIFile *Fg);
711 bool CreateSkeletonCU);
714 llvm::DIModule *getParentModuleOrNull(
const Decl *
D);
718 llvm::DICompositeType *getOrCreateLimitedType(
const RecordType *Ty);
721 llvm::DIType *CreateTypeNode(
QualType Ty, llvm::DIFile *Fg);
724 llvm::DIType *CreateMemberType(llvm::DIFile *Unit,
QualType FType,
725 StringRef Name, uint64_t *Offset);
729 llvm::DINode *getDeclarationOrDefinition(
const Decl *
D);
733 llvm::DISubprogram *getFunctionDeclaration(
const Decl *
D);
742 getObjCMethodDeclaration(
const Decl *
D, llvm::DISubroutineType *FnType,
743 unsigned LineNo, llvm::DINode::DIFlags Flags,
744 llvm::DISubprogram::DISPFlags SPFlags);
750 llvm::DIDerivedType *
751 getOrCreateStaticDataMemberDeclarationOrNull(
const VarDecl *
D);
754 llvm::DISubprogram *getFunctionFwdDeclOrStub(
GlobalDecl GD,
bool Stub);
758 llvm::DISubprogram *getFunctionForwardDeclaration(
GlobalDecl GD);
762 llvm::DISubprogram *getFunctionStub(
GlobalDecl GD);
766 llvm::DIGlobalVariable *
767 getGlobalVariableForwardDeclaration(
const VarDecl *VD);
776 llvm::DIGlobalVariableExpression *
777 CollectAnonRecordDecls(
const RecordDecl *RD, llvm::DIFile *Unit,
778 unsigned LineNo, StringRef LinkageName,
779 llvm::GlobalVariable *Var, llvm::DIScope *DContext);
784 llvm::DINode::DIFlags getCallSiteRelatedAttrs()
const;
800 StringRef getSelectorName(
Selector S);
810 StringRef getDynamicInitializerName(
const VarDecl *VD,
812 llvm::Function *InitFn);
825 void collectFunctionDeclProps(
GlobalDecl GD, llvm::DIFile *Unit,
826 StringRef &Name, StringRef &LinkageName,
827 llvm::DIScope *&FDContext,
828 llvm::DINodeArray &TParamsArray,
829 llvm::DINode::DIFlags &Flags);
832 void collectVarDeclProps(
const VarDecl *VD, llvm::DIFile *&Unit,
833 unsigned &LineNo,
QualType &
T, StringRef &Name,
834 StringRef &LinkageName,
835 llvm::MDTuple *&TemplateParameters,
836 llvm::DIScope *&VDContext);
840 llvm::DIExpression *createConstantValueExpression(
const clang::ValueDecl *VD,
846 StringRef internString(StringRef A, StringRef B = StringRef()) {
847 char *
Data = DebugInfoNames.Allocate<
char>(A.size() + B.size());
849 std::memcpy(
Data, A.data(), A.size());
851 std::memcpy(
Data + A.size(), B.data(), B.size());
852 return StringRef(
Data, A.size() + B.size());
860 void init(
SourceLocation TemporaryLocation,
bool DefaultToEmpty =
false);
864 llvm::DebugLoc OriginalLocation;
878 if (
this != &
Other) {
Defines the clang::ASTSourceDescriptor class, which abstracts clang modules and precompiled header fi...
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the clang::SourceLocation class and associated facilities.
Allows QualTypes to be sorted and hence used in maps and sets.
TypePropertyCache< Private > Cache
C Language Family Type Representation.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Abstracts clang modules and precompiled header files and holds everything needed to generate debug in...
A binding in a decomposition declaration.
Represents a C++ struct/union/class.
llvm::iterator_range< base_class_const_iterator > base_class_const_range
Represents a class template specialization, which refers to a class template with a given set of temp...
A scoped helper to set the current debug location to the specified location or preferred location of ...
static ApplyDebugLocation CreateArtificial(CodeGenFunction &CGF)
Apply TemporaryLocation if it is valid.
static ApplyDebugLocation CreateDefaultArtificial(CodeGenFunction &CGF, SourceLocation TemporaryLocation)
Apply TemporaryLocation if it is valid.
ApplyDebugLocation(ApplyDebugLocation &&Other)
static ApplyDebugLocation CreateEmpty(CodeGenFunction &CGF)
Set the IRBuilder to not attach debug locations.
ApplyDebugLocation & operator=(ApplyDebugLocation &&Other)
A scoped helper to set the current debug location to an inlined location.
~ApplyInlineDebugLocation()
Restore everything back to the original state.
CGBlockInfo - Information to generate a block literal.
This class gathers all debug information during compilation and is responsible for emitting to llvm g...
llvm::MDNode * getInlinedAt() const
llvm::DIType * getOrCreateStandaloneType(QualType Ty, SourceLocation Loc)
Emit standalone debug info for a type.
void EmitLocation(CGBuilderTy &Builder, SourceLocation Loc)
Emit metadata to indicate a change in line/column information in the source file.
void EmitGlobalAlias(const llvm::GlobalValue *GV, const GlobalDecl Decl)
Emit information about global variable alias.
void EmitLabel(const LabelDecl *D, CGBuilderTy &Builder)
Emit call to llvm.dbg.label for an label.
void EmitGlobalVariable(llvm::GlobalVariable *GV, const VarDecl *Decl)
Emit information about a global variable.
void setInlinedAt(llvm::MDNode *InlinedAt)
Update the current inline scope.
void completeUnusedClass(const CXXRecordDecl &D)
SourceLocation getLocation() const
Return the current source location.
void EmitUsingShadowDecl(const UsingShadowDecl &USD)
Emit a shadow decl brought in by a using or using-enum.
void EmitUsingEnumDecl(const UsingEnumDecl &UD)
Emit C++ using-enum declaration.
void EmitFunctionEnd(CGBuilderTy &Builder, llvm::Function *Fn)
Constructs the debug code for exiting a function.
void EmitFuncDeclForCallSite(llvm::CallBase *CallOrInvoke, QualType CalleeType, const FunctionDecl *CalleeDecl)
Emit debug info for an extern function being called.
void EmitUsingDecl(const UsingDecl &UD)
Emit C++ using declaration.
llvm::DIMacroFile * CreateTempMacroFile(llvm::DIMacroFile *Parent, SourceLocation LineLoc, SourceLocation FileLoc)
Create debug info for a file referenced by an #include directive.
void completeTemplateDefinition(const ClassTemplateSpecializationDecl &SD)
void EmitExternalVariable(llvm::GlobalVariable *GV, const VarDecl *Decl)
Emit information about an external variable.
Param2DILocTy & getParamDbgMappings()
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.
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 EmitLexicalBlockEnd(CGBuilderTy &Builder, SourceLocation Loc)
Emit metadata to indicate the end of a new lexical block and pop the current block.
void EmitUsingDirective(const UsingDirectiveDecl &UD)
Emit C++ using directive.
void completeRequiredType(const RecordDecl *RD)
void EmitAndRetainType(QualType Ty)
Emit the type even if it might not be used.
void EmitInlineFunctionEnd(CGBuilderTy &Builder)
End an inlined function scope.
ParamDecl2StmtTy & getCoroutineParameterMappings()
void EmitFunctionDecl(GlobalDecl GD, SourceLocation Loc, QualType FnType, llvm::Function *Fn=nullptr)
Emit debug info for a function declaration.
void AddStringLiteralDebugInfo(llvm::GlobalVariable *GV, const StringLiteral *S)
DebugInfo isn't attached to string literals by default.
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 completeClassData(const RecordDecl *RD)
void EmitInlineFunctionStart(CGBuilderTy &Builder, GlobalDecl GD)
Start a new scope for an inlined function.
void setModuleMap(ModuleMap &MMap)
When generating debug information for a clang module or precompiled header, this module map will be u...
void EmitImportDecl(const ImportDecl &ID)
Emit an @import 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.
llvm::DebugLoc SourceLocToDebugLoc(SourceLocation Loc)
CGDebugInfo(CodeGenModule &CGM)
void completeClass(const RecordDecl *RD)
void EmitLexicalBlockStart(CGBuilderTy &Builder, SourceLocation Loc)
Emit metadata to indicate the beginning of a new lexical block and push the block onto the stack.
friend class SaveAndRestoreLocation
void setLocation(SourceLocation Loc)
Update the current source location.
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 directi...
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 i...
llvm::DIType * getOrCreateRecordType(QualType Ty, SourceLocation L)
Emit record type's standalone debug info.
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 variab...
std::string remapDIPath(StringRef) const
Remap a given path with the current debug prefix map.
void EmitExplicitCastType(QualType Ty)
Emit the type explicitly casted to.
void addHeapAllocSiteMetadata(llvm::CallBase *CallSite, QualType AllocatedTy, SourceLocation Loc)
Add heapallocsite metadata for MSAllocator calls.
void setDwoId(uint64_t Signature)
Module debugging: Support for building PCMs.
QualType getFunctionType(const FunctionDecl *FD, QualType RetTy, const SmallVectorImpl< const VarDecl * > &Args)
llvm::DIType * getOrCreateInterfaceType(QualType Ty, SourceLocation Loc)
Emit an Objective-C interface type standalone debug info.
void setPCHDescriptor(ASTSourceDescriptor PCH)
When generating debug information for a clang module or precompiled header, this module map will be u...
void completeType(const EnumDecl *ED)
void registerVLASizeExpression(QualType Ty, llvm::Metadata *SizeExpr)
Register VLA size expression debug node with the qualified type.
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::DIImportedEntity * EmitNamespaceAlias(const NamespaceAliasDecl &NA)
Emit C++ namespace alias.
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
This class organizes the cross-function state that is used while generating LLVM code.
Decl - This represents one declaration (or definition), e.g.
This represents one expression.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Represents a function declaration or definition.
GlobalDecl - represents a global declaration.
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Represents the declaration of a label.
Represents a C++ namespace alias.
ObjCMethodDecl - Represents an instance or class method declaration.
Callbacks to use to customize the behavior of the pretty-printer.
A (possibly-)qualified type.
Represents a struct/union/class.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Smart pointer class that efficiently represents Objective-C method names.
Encodes a location in the source.
This class handles loading and caching of source files into memory.
StringLiteral - This represents a string literal expression, e.g.
Represents a C++ using-declaration.
Represents C++ using-directive.
Represents a C++ using-enum-declaration.
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a variable declaration or definition.
@ Type
The l-value was considered opaque, so the alignment was determined from a type.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
The JSON file list parser is used to communicate input to InstallAPI.
@ Module
Module linkage, which indicates that the entity can be referred to from other translation units withi...
const FunctionProtoType * T
@ PCH
Disable validation for a precompiled header and the modules it depends on.
@ Other
Other implicit parameter.
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Diagnostic wrappers for TextAPI types for error reporting.
Describes how types, statements, expressions, and declarations should be printed.