clang  19.0.0git
CGDebugInfo.h
Go to the documentation of this file.
1 //===--- CGDebugInfo.h - DebugInfo for LLVM CodeGen -------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This is the source-level debug info generator for llvm translation.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CLANG_LIB_CODEGEN_CGDEBUGINFO_H
14 #define LLVM_CLANG_LIB_CODEGEN_CGDEBUGINFO_H
15 
16 #include "CGBuilder.h"
17 #include "clang/AST/DeclCXX.h"
18 #include "clang/AST/Expr.h"
21 #include "clang/AST/Type.h"
22 #include "clang/AST/TypeOrdering.h"
24 #include "clang/Basic/Module.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"
32 #include <optional>
33 
34 namespace llvm {
35 class MDNode;
36 }
37 
38 namespace clang {
39 class ClassTemplateSpecializationDecl;
40 class GlobalDecl;
41 class ModuleMap;
42 class ObjCInterfaceDecl;
43 class UsingDecl;
44 class VarDecl;
45 enum class DynamicInitKind : unsigned;
46 
47 namespace CodeGen {
48 class CodeGenModule;
49 class CodeGenFunction;
50 class CGBlockInfo;
51 
52 /// This class gathers all debug information during compilation and is
53 /// responsible for emitting to llvm globals or pass directly to the
54 /// backend.
55 class CGDebugInfo {
56  friend class ApplyDebugLocation;
57  friend class SaveAndRestoreLocation;
58  CodeGenModule &CGM;
59  const llvm::codegenoptions::DebugInfoKind DebugKind;
60  bool DebugTypeExtRefs;
61  llvm::DIBuilder DBuilder;
62  llvm::DICompileUnit *TheCU = nullptr;
63  ModuleMap *ClangModuleMap = nullptr;
64  ASTSourceDescriptor PCHDescriptor;
65  SourceLocation CurLoc;
66  llvm::MDNode *CurInlinedAt = nullptr;
67  llvm::DIType *VTablePtrType = nullptr;
68  llvm::DIType *ClassTy = nullptr;
69  llvm::DICompositeType *ObjTy = nullptr;
70  llvm::DIType *SelTy = nullptr;
71 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
72  llvm::DIType *SingletonId = nullptr;
73 #include "clang/Basic/OpenCLImageTypes.def"
74 #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
75  llvm::DIType *Sampled##SingletonId = nullptr;
76 #define IMAGE_WRITE_TYPE(Type, Id, Ext)
77 #define IMAGE_READ_WRITE_TYPE(Type, Id, Ext)
78 #include "clang/Basic/OpenCLImageTypes.def"
79  llvm::DIType *OCLSamplerDITy = nullptr;
80  llvm::DIType *OCLEventDITy = nullptr;
81  llvm::DIType *OCLClkEventDITy = nullptr;
82  llvm::DIType *OCLQueueDITy = nullptr;
83  llvm::DIType *OCLNDRangeDITy = nullptr;
84  llvm::DIType *OCLReserveIDDITy = nullptr;
85 #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
86  llvm::DIType *Id##Ty = nullptr;
87 #include "clang/Basic/OpenCLExtensionTypes.def"
88 #define WASM_TYPE(Name, Id, SingletonId) llvm::DIType *SingletonId = nullptr;
89 #include "clang/Basic/WebAssemblyReferenceTypes.def"
90 
91  /// Cache of previously constructed Types.
92  llvm::DenseMap<const void *, llvm::TrackingMDRef> TypeCache;
93 
94  /// Cache that maps VLA types to size expressions for that type,
95  /// represented by instantiated Metadata nodes.
96  llvm::SmallDenseMap<QualType, llvm::Metadata *> SizeExprCache;
97 
98  /// Callbacks to use when printing names and types.
99  class PrintingCallbacks final : public clang::PrintingCallbacks {
100  const CGDebugInfo &Self;
101 
102  public:
103  PrintingCallbacks(const CGDebugInfo &Self) : Self(Self) {}
104  std::string remapPath(StringRef Path) const override {
105  return Self.remapDIPath(Path);
106  }
107  };
108  PrintingCallbacks PrintCB = {*this};
109 
110  struct ObjCInterfaceCacheEntry {
111  const ObjCInterfaceType *Type;
112  llvm::DIType *Decl;
113  llvm::DIFile *Unit;
114  ObjCInterfaceCacheEntry(const ObjCInterfaceType *Type, llvm::DIType *Decl,
115  llvm::DIFile *Unit)
116  : Type(Type), Decl(Decl), Unit(Unit) {}
117  };
118 
119  /// Cache of previously constructed interfaces which may change.
121 
122  /// Cache of forward declarations for methods belonging to the interface.
123  /// The extra bit on the DISubprogram specifies whether a method is
124  /// "objc_direct".
125  llvm::DenseMap<const ObjCInterfaceDecl *,
126  std::vector<llvm::PointerIntPair<llvm::DISubprogram *, 1>>>
127  ObjCMethodCache;
128 
129  /// Cache of references to clang modules and precompiled headers.
130  llvm::DenseMap<const Module *, llvm::TrackingMDRef> ModuleCache;
131 
132  /// List of interfaces we want to keep even if orphaned.
133  std::vector<void *> RetainedTypes;
134 
135  /// Cache of forward declared types to RAUW at the end of compilation.
136  std::vector<std::pair<const TagType *, llvm::TrackingMDRef>> ReplaceMap;
137 
138  /// Cache of replaceable forward declarations (functions and
139  /// variables) to RAUW at the end of compilation.
140  std::vector<std::pair<const DeclaratorDecl *, llvm::TrackingMDRef>>
141  FwdDeclReplaceMap;
142 
143  /// Keep track of our current nested lexical block.
144  std::vector<llvm::TypedTrackingMDRef<llvm::DIScope>> LexicalBlockStack;
145  llvm::DenseMap<const Decl *, llvm::TrackingMDRef> RegionMap;
146  /// Keep track of LexicalBlockStack counter at the beginning of a
147  /// function. This is used to pop unbalanced regions at the end of a
148  /// function.
149  std::vector<unsigned> FnBeginRegionCount;
150 
151  /// This is a storage for names that are constructed on demand. For
152  /// example, C++ destructors, C++ operators etc..
153  llvm::BumpPtrAllocator DebugInfoNames;
154  StringRef CWDName;
155 
156  llvm::DenseMap<const char *, llvm::TrackingMDRef> DIFileCache;
157  llvm::DenseMap<const FunctionDecl *, llvm::TrackingMDRef> SPCache;
158  /// Cache declarations relevant to DW_TAG_imported_declarations (C++
159  /// using declarations and global alias variables) that aren't covered
160  /// by other more specific caches.
161  llvm::DenseMap<const Decl *, llvm::TrackingMDRef> DeclCache;
162  llvm::DenseMap<const Decl *, llvm::TrackingMDRef> ImportedDeclCache;
163  llvm::DenseMap<const NamespaceDecl *, llvm::TrackingMDRef> NamespaceCache;
164  llvm::DenseMap<const NamespaceAliasDecl *, llvm::TrackingMDRef>
165  NamespaceAliasCache;
166  llvm::DenseMap<const Decl *, llvm::TypedTrackingMDRef<llvm::DIDerivedType>>
167  StaticDataMemberCache;
168 
169  using ParamDecl2StmtTy = llvm::DenseMap<const ParmVarDecl *, const Stmt *>;
170  using Param2DILocTy =
171  llvm::DenseMap<const ParmVarDecl *, llvm::DILocalVariable *>;
172 
173  /// The key is coroutine real parameters, value is coroutine move parameters.
174  ParamDecl2StmtTy CoroutineParameterMappings;
175  /// The key is coroutine real parameters, value is DIVariable in LLVM IR.
176  Param2DILocTy ParamDbgMappings;
177 
178  /// Helper functions for getOrCreateType.
179  /// @{
180  /// Currently the checksum of an interface includes the number of
181  /// ivars and property accessors.
182  llvm::DIType *CreateType(const BuiltinType *Ty);
183  llvm::DIType *CreateType(const ComplexType *Ty);
184  llvm::DIType *CreateType(const BitIntType *Ty);
185  llvm::DIType *CreateQualifiedType(QualType Ty, llvm::DIFile *Fg);
186  llvm::DIType *CreateQualifiedType(const FunctionProtoType *Ty,
187  llvm::DIFile *Fg);
188  llvm::DIType *CreateType(const TypedefType *Ty, llvm::DIFile *Fg);
189  llvm::DIType *CreateType(const TemplateSpecializationType *Ty,
190  llvm::DIFile *Fg);
191  llvm::DIType *CreateType(const ObjCObjectPointerType *Ty, llvm::DIFile *F);
192  llvm::DIType *CreateType(const PointerType *Ty, llvm::DIFile *F);
193  llvm::DIType *CreateType(const BlockPointerType *Ty, llvm::DIFile *F);
194  llvm::DIType *CreateType(const FunctionType *Ty, llvm::DIFile *F);
195  /// Get structure or union type.
196  llvm::DIType *CreateType(const RecordType *Tyg);
197 
198  /// Create definition for the specified 'Ty'.
199  ///
200  /// \returns A pair of 'llvm::DIType's. The first is the definition
201  /// of the 'Ty'. The second is the type specified by the preferred_name
202  /// attribute on 'Ty', which can be a nullptr if no such attribute
203  /// exists.
204  std::pair<llvm::DIType *, llvm::DIType *>
205  CreateTypeDefinition(const RecordType *Ty);
206  llvm::DICompositeType *CreateLimitedType(const RecordType *Ty);
207  void CollectContainingType(const CXXRecordDecl *RD,
208  llvm::DICompositeType *CT);
209  /// Get Objective-C interface type.
210  llvm::DIType *CreateType(const ObjCInterfaceType *Ty, llvm::DIFile *F);
211  llvm::DIType *CreateTypeDefinition(const ObjCInterfaceType *Ty,
212  llvm::DIFile *F);
213  /// Get Objective-C object type.
214  llvm::DIType *CreateType(const ObjCObjectType *Ty, llvm::DIFile *F);
215  llvm::DIType *CreateType(const ObjCTypeParamType *Ty, llvm::DIFile *Unit);
216 
217  llvm::DIType *CreateType(const VectorType *Ty, llvm::DIFile *F);
218  llvm::DIType *CreateType(const ConstantMatrixType *Ty, llvm::DIFile *F);
219  llvm::DIType *CreateType(const ArrayType *Ty, llvm::DIFile *F);
220  llvm::DIType *CreateType(const LValueReferenceType *Ty, llvm::DIFile *F);
221  llvm::DIType *CreateType(const RValueReferenceType *Ty, llvm::DIFile *Unit);
222  llvm::DIType *CreateType(const MemberPointerType *Ty, llvm::DIFile *F);
223  llvm::DIType *CreateType(const AtomicType *Ty, llvm::DIFile *F);
224  llvm::DIType *CreateType(const PipeType *Ty, llvm::DIFile *F);
225  /// Get enumeration type.
226  llvm::DIType *CreateEnumType(const EnumType *Ty);
227  llvm::DIType *CreateTypeDefinition(const EnumType *Ty);
228  /// Look up the completed type for a self pointer in the TypeCache and
229  /// create a copy of it with the ObjectPointer and Artificial flags
230  /// set. If the type is not cached, a new one is created. This should
231  /// never happen though, since creating a type for the implicit self
232  /// argument implies that we already parsed the interface definition
233  /// and the ivar declarations in the implementation.
234  llvm::DIType *CreateSelfType(const QualType &QualTy, llvm::DIType *Ty);
235  /// @}
236 
237  /// Get the type from the cache or return null type if it doesn't
238  /// exist.
239  llvm::DIType *getTypeOrNull(const QualType);
240  /// Return the debug type for a C++ method.
241  /// \arg CXXMethodDecl is of FunctionType. This function type is
242  /// not updated to include implicit \c this pointer. Use this routine
243  /// to get a method type which includes \c this pointer.
244  llvm::DISubroutineType *getOrCreateMethodType(const CXXMethodDecl *Method,
245  llvm::DIFile *F);
246  llvm::DISubroutineType *
247  getOrCreateInstanceMethodType(QualType ThisPtr, const FunctionProtoType *Func,
248  llvm::DIFile *Unit);
249  llvm::DISubroutineType *
250  getOrCreateFunctionType(const Decl *D, QualType FnType, llvm::DIFile *F);
251  /// \return debug info descriptor for vtable.
252  llvm::DIType *getOrCreateVTablePtrType(llvm::DIFile *F);
253 
254  /// \return namespace descriptor for the given namespace decl.
255  llvm::DINamespace *getOrCreateNamespace(const NamespaceDecl *N);
256  llvm::DIType *CreatePointerLikeType(llvm::dwarf::Tag Tag, const Type *Ty,
257  QualType PointeeTy, llvm::DIFile *F);
258  llvm::DIType *getOrCreateStructPtrType(StringRef Name, llvm::DIType *&Cache);
259 
260  /// A helper function to create a subprogram for a single member
261  /// function GlobalDecl.
262  llvm::DISubprogram *CreateCXXMemberFunction(const CXXMethodDecl *Method,
263  llvm::DIFile *F,
264  llvm::DIType *RecordTy);
265 
266  /// A helper function to collect debug info for C++ member
267  /// functions. This is used while creating debug info entry for a
268  /// Record.
269  void CollectCXXMemberFunctions(const CXXRecordDecl *Decl, llvm::DIFile *F,
270  SmallVectorImpl<llvm::Metadata *> &E,
271  llvm::DIType *T);
272 
273  /// A helper function to collect debug info for C++ base
274  /// classes. This is used while creating debug info entry for a
275  /// Record.
276  void CollectCXXBases(const CXXRecordDecl *Decl, llvm::DIFile *F,
277  SmallVectorImpl<llvm::Metadata *> &EltTys,
278  llvm::DIType *RecordTy);
279 
280  /// Helper function for CollectCXXBases.
281  /// Adds debug info entries for types in Bases that are not in SeenTypes.
282  void CollectCXXBasesAux(
283  const CXXRecordDecl *RD, llvm::DIFile *Unit,
284  SmallVectorImpl<llvm::Metadata *> &EltTys, llvm::DIType *RecordTy,
286  llvm::DenseSet<CanonicalDeclPtr<const CXXRecordDecl>> &SeenTypes,
287  llvm::DINode::DIFlags StartingFlags);
288 
289  /// Helper function that returns the llvm::DIType that the
290  /// PreferredNameAttr attribute on \ref RD refers to. If no such
291  /// attribute exists, returns nullptr.
292  llvm::DIType *GetPreferredNameType(const CXXRecordDecl *RD,
293  llvm::DIFile *Unit);
294 
295  struct TemplateArgs {
296  const TemplateParameterList *TList;
298  };
299  /// A helper function to collect template parameters.
300  llvm::DINodeArray CollectTemplateParams(std::optional<TemplateArgs> Args,
301  llvm::DIFile *Unit);
302  /// A helper function to collect debug info for function template
303  /// parameters.
304  llvm::DINodeArray CollectFunctionTemplateParams(const FunctionDecl *FD,
305  llvm::DIFile *Unit);
306 
307  /// A helper function to collect debug info for function template
308  /// parameters.
309  llvm::DINodeArray CollectVarTemplateParams(const VarDecl *VD,
310  llvm::DIFile *Unit);
311 
312  std::optional<TemplateArgs> GetTemplateArgs(const VarDecl *) const;
313  std::optional<TemplateArgs> GetTemplateArgs(const RecordDecl *) const;
314  std::optional<TemplateArgs> GetTemplateArgs(const FunctionDecl *) const;
315 
316  /// A helper function to collect debug info for template
317  /// parameters.
318  llvm::DINodeArray CollectCXXTemplateParams(const RecordDecl *TS,
319  llvm::DIFile *F);
320 
321  /// A helper function to collect debug info for btf_decl_tag annotations.
322  llvm::DINodeArray CollectBTFDeclTagAnnotations(const Decl *D);
323 
324  llvm::DIType *createFieldType(StringRef name, QualType type,
325  SourceLocation loc, AccessSpecifier AS,
326  uint64_t offsetInBits, uint32_t AlignInBits,
327  llvm::DIFile *tunit, llvm::DIScope *scope,
328  const RecordDecl *RD = nullptr,
329  llvm::DINodeArray Annotations = nullptr);
330 
331  llvm::DIType *createFieldType(StringRef name, QualType type,
332  SourceLocation loc, AccessSpecifier AS,
333  uint64_t offsetInBits, llvm::DIFile *tunit,
334  llvm::DIScope *scope,
335  const RecordDecl *RD = nullptr) {
336  return createFieldType(name, type, loc, AS, offsetInBits, 0, tunit, scope,
337  RD);
338  }
339 
340  /// Create new bit field member.
341  llvm::DIDerivedType *createBitFieldType(const FieldDecl *BitFieldDecl,
342  llvm::DIScope *RecordTy,
343  const RecordDecl *RD);
344 
345  /// Create type for binding declarations.
346  llvm::DIType *CreateBindingDeclType(const BindingDecl *BD);
347 
348  /// Create an anonnymous zero-size separator for bit-field-decl if needed on
349  /// the target.
350  llvm::DIDerivedType *createBitFieldSeparatorIfNeeded(
351  const FieldDecl *BitFieldDecl, const llvm::DIDerivedType *BitFieldDI,
352  llvm::ArrayRef<llvm::Metadata *> PreviousFieldsDI, const RecordDecl *RD);
353 
354  /// Helpers for collecting fields of a record.
355  /// @{
356  void CollectRecordLambdaFields(const CXXRecordDecl *CXXDecl,
357  SmallVectorImpl<llvm::Metadata *> &E,
358  llvm::DIType *RecordTy);
359  llvm::DIDerivedType *CreateRecordStaticField(const VarDecl *Var,
360  llvm::DIType *RecordTy,
361  const RecordDecl *RD);
362  void CollectRecordNormalField(const FieldDecl *Field, uint64_t OffsetInBits,
363  llvm::DIFile *F,
364  SmallVectorImpl<llvm::Metadata *> &E,
365  llvm::DIType *RecordTy, const RecordDecl *RD);
366  void CollectRecordNestedType(const TypeDecl *RD,
367  SmallVectorImpl<llvm::Metadata *> &E);
368  void CollectRecordFields(const RecordDecl *Decl, llvm::DIFile *F,
369  SmallVectorImpl<llvm::Metadata *> &E,
370  llvm::DICompositeType *RecordTy);
371 
372  /// If the C++ class has vtable info then insert appropriate debug
373  /// info entry in EltTys vector.
374  void CollectVTableInfo(const CXXRecordDecl *Decl, llvm::DIFile *F,
375  SmallVectorImpl<llvm::Metadata *> &EltTys);
376  /// @}
377 
378  /// Create a new lexical block node and push it on the stack.
379  void CreateLexicalBlock(SourceLocation Loc);
380 
381  /// If target-specific LLVM \p AddressSpace directly maps to target-specific
382  /// DWARF address space, appends extended dereferencing mechanism to complex
383  /// expression \p Expr. Otherwise, does nothing.
384  ///
385  /// Extended dereferencing mechanism is has the following format:
386  /// DW_OP_constu <DWARF Address Space> DW_OP_swap DW_OP_xderef
387  void AppendAddressSpaceXDeref(unsigned AddressSpace,
388  SmallVectorImpl<uint64_t> &Expr) const;
389 
390  /// A helper function to collect debug info for the default elements of a
391  /// block.
392  ///
393  /// \returns The next available field offset after the default elements.
394  uint64_t collectDefaultElementTypesForBlockPointer(
395  const BlockPointerType *Ty, llvm::DIFile *Unit,
396  llvm::DIDerivedType *DescTy, unsigned LineNo,
397  SmallVectorImpl<llvm::Metadata *> &EltTys);
398 
399  /// A helper function to collect debug info for the default fields of a
400  /// block.
401  void collectDefaultFieldsForBlockLiteralDeclare(
402  const CGBlockInfo &Block, const ASTContext &Context, SourceLocation Loc,
403  const llvm::StructLayout &BlockLayout, llvm::DIFile *Unit,
404  SmallVectorImpl<llvm::Metadata *> &Fields);
405 
406 public:
407  CGDebugInfo(CodeGenModule &CGM);
408  ~CGDebugInfo();
409 
410  void finalize();
411 
412  /// Remap a given path with the current debug prefix map
413  std::string remapDIPath(StringRef) const;
414 
415  /// Register VLA size expression debug node with the qualified type.
416  void registerVLASizeExpression(QualType Ty, llvm::Metadata *SizeExpr) {
417  SizeExprCache[Ty] = SizeExpr;
418  }
419 
420  /// Module debugging: Support for building PCMs.
421  /// @{
422  /// Set the main CU's DwoId field to \p Signature.
423  void setDwoId(uint64_t Signature);
424 
425  /// When generating debug information for a clang module or
426  /// precompiled header, this module map will be used to determine
427  /// the module of origin of each Decl.
428  void setModuleMap(ModuleMap &MMap) { ClangModuleMap = &MMap; }
429 
430  /// When generating debug information for a clang module or
431  /// precompiled header, this module map will be used to determine
432  /// the module of origin of each Decl.
433  void setPCHDescriptor(ASTSourceDescriptor PCH) { PCHDescriptor = PCH; }
434  /// @}
435 
436  /// Update the current source location. If \arg loc is invalid it is
437  /// ignored.
438  void setLocation(SourceLocation Loc);
439 
440  /// Return the current source location. This does not necessarily correspond
441  /// to the IRBuilder's current DebugLoc.
442  SourceLocation getLocation() const { return CurLoc; }
443 
444  /// Update the current inline scope. All subsequent calls to \p EmitLocation
445  /// will create a location with this inlinedAt field.
446  void setInlinedAt(llvm::MDNode *InlinedAt) { CurInlinedAt = InlinedAt; }
447 
448  /// \return the current inline scope.
449  llvm::MDNode *getInlinedAt() const { return CurInlinedAt; }
450 
451  // Converts a SourceLocation to a DebugLoc
452  llvm::DebugLoc SourceLocToDebugLoc(SourceLocation Loc);
453 
454  /// Emit metadata to indicate a change in line/column information in
455  /// the source file. If the location is invalid, the previous
456  /// location will be reused.
457  void EmitLocation(CGBuilderTy &Builder, SourceLocation Loc);
458 
459  QualType getFunctionType(const FunctionDecl *FD, QualType RetTy,
461 
462  /// Emit a call to llvm.dbg.function.start to indicate
463  /// start of a new function.
464  /// \param Loc The location of the function header.
465  /// \param ScopeLoc The location of the function body.
466  void emitFunctionStart(GlobalDecl GD, SourceLocation Loc,
467  SourceLocation ScopeLoc, QualType FnType,
468  llvm::Function *Fn, bool CurFnIsThunk);
469 
470  /// Start a new scope for an inlined function.
471  void EmitInlineFunctionStart(CGBuilderTy &Builder, GlobalDecl GD);
472  /// End an inlined function scope.
473  void EmitInlineFunctionEnd(CGBuilderTy &Builder);
474 
475  /// Emit debug info for a function declaration.
476  /// \p Fn is set only when a declaration for a debug call site gets created.
477  void EmitFunctionDecl(GlobalDecl GD, SourceLocation Loc,
478  QualType FnType, llvm::Function *Fn = nullptr);
479 
480  /// Emit debug info for an extern function being called.
481  /// This is needed for call site debug info.
482  void EmitFuncDeclForCallSite(llvm::CallBase *CallOrInvoke,
483  QualType CalleeType,
484  const FunctionDecl *CalleeDecl);
485 
486  /// Constructs the debug code for exiting a function.
487  void EmitFunctionEnd(CGBuilderTy &Builder, llvm::Function *Fn);
488 
489  /// Emit metadata to indicate the beginning of a new lexical block
490  /// and push the block onto the stack.
491  void EmitLexicalBlockStart(CGBuilderTy &Builder, SourceLocation Loc);
492 
493  /// Emit metadata to indicate the end of a new lexical block and pop
494  /// the current block.
495  void EmitLexicalBlockEnd(CGBuilderTy &Builder, SourceLocation Loc);
496 
497  /// Emit call to \c llvm.dbg.declare for an automatic variable
498  /// declaration.
499  /// Returns a pointer to the DILocalVariable associated with the
500  /// llvm.dbg.declare, or nullptr otherwise.
501  llvm::DILocalVariable *
502  EmitDeclareOfAutoVariable(const VarDecl *Decl, llvm::Value *AI,
503  CGBuilderTy &Builder,
504  const bool UsePointerValue = false);
505 
506  /// Emit call to \c llvm.dbg.label for an label.
507  void EmitLabel(const LabelDecl *D, CGBuilderTy &Builder);
508 
509  /// Emit call to \c llvm.dbg.declare for an imported variable
510  /// declaration in a block.
511  void EmitDeclareOfBlockDeclRefVariable(
512  const VarDecl *variable, llvm::Value *storage, CGBuilderTy &Builder,
513  const CGBlockInfo &blockInfo, llvm::Instruction *InsertPoint = nullptr);
514 
515  /// Emit call to \c llvm.dbg.declare for an argument variable
516  /// declaration.
517  llvm::DILocalVariable *
518  EmitDeclareOfArgVariable(const VarDecl *Decl, llvm::Value *AI, unsigned ArgNo,
519  CGBuilderTy &Builder, bool UsePointerValue = false);
520 
521  /// Emit call to \c llvm.dbg.declare for the block-literal argument
522  /// to a block invocation function.
523  void EmitDeclareOfBlockLiteralArgVariable(const CGBlockInfo &block,
524  StringRef Name, unsigned ArgNo,
525  llvm::AllocaInst *LocalAddr,
526  CGBuilderTy &Builder);
527 
528  /// Emit information about a global variable.
529  void EmitGlobalVariable(llvm::GlobalVariable *GV, const VarDecl *Decl);
530 
531  /// Emit a constant global variable's debug info.
532  void EmitGlobalVariable(const ValueDecl *VD, const APValue &Init);
533 
534  /// Emit information about an external variable.
535  void EmitExternalVariable(llvm::GlobalVariable *GV, const VarDecl *Decl);
536 
537  /// Emit information about global variable alias.
538  void EmitGlobalAlias(const llvm::GlobalValue *GV, const GlobalDecl Decl);
539 
540  /// Emit C++ using directive.
541  void EmitUsingDirective(const UsingDirectiveDecl &UD);
542 
543  /// Emit the type explicitly casted to.
544  void EmitExplicitCastType(QualType Ty);
545 
546  /// Emit the type even if it might not be used.
547  void EmitAndRetainType(QualType Ty);
548 
549  /// Emit a shadow decl brought in by a using or using-enum
550  void EmitUsingShadowDecl(const UsingShadowDecl &USD);
551 
552  /// Emit C++ using declaration.
553  void EmitUsingDecl(const UsingDecl &UD);
554 
555  /// Emit C++ using-enum declaration.
556  void EmitUsingEnumDecl(const UsingEnumDecl &UD);
557 
558  /// Emit an @import declaration.
559  void EmitImportDecl(const ImportDecl &ID);
560 
561  /// DebugInfo isn't attached to string literals by default. While certain
562  /// aspects of debuginfo aren't useful for string literals (like a name), it's
563  /// nice to be able to symbolize the line and column information. This is
564  /// especially useful for sanitizers, as it allows symbolization of
565  /// heap-buffer-overflows on constant strings.
566  void AddStringLiteralDebugInfo(llvm::GlobalVariable *GV,
567  const StringLiteral *S);
568 
569  /// Emit C++ namespace alias.
570  llvm::DIImportedEntity *EmitNamespaceAlias(const NamespaceAliasDecl &NA);
571 
572  /// Emit record type's standalone debug info.
573  llvm::DIType *getOrCreateRecordType(QualType Ty, SourceLocation L);
574 
575  /// Emit an Objective-C interface type standalone debug info.
576  llvm::DIType *getOrCreateInterfaceType(QualType Ty, SourceLocation Loc);
577 
578  /// Emit standalone debug info for a type.
579  llvm::DIType *getOrCreateStandaloneType(QualType Ty, SourceLocation Loc);
580 
581  /// Add heapallocsite metadata for MSAllocator calls.
582  void addHeapAllocSiteMetadata(llvm::CallBase *CallSite, QualType AllocatedTy,
584 
585  void completeType(const EnumDecl *ED);
586  void completeType(const RecordDecl *RD);
587  void completeRequiredType(const RecordDecl *RD);
588  void completeClassData(const RecordDecl *RD);
589  void completeClass(const RecordDecl *RD);
590 
591  void completeTemplateDefinition(const ClassTemplateSpecializationDecl &SD);
592  void completeUnusedClass(const CXXRecordDecl &D);
593 
594  /// Create debug info for a macro defined by a #define directive or a macro
595  /// undefined by a #undef directive.
596  llvm::DIMacro *CreateMacro(llvm::DIMacroFile *Parent, unsigned MType,
597  SourceLocation LineLoc, StringRef Name,
598  StringRef Value);
599 
600  /// Create debug info for a file referenced by an #include directive.
601  llvm::DIMacroFile *CreateTempMacroFile(llvm::DIMacroFile *Parent,
602  SourceLocation LineLoc,
603  SourceLocation FileLoc);
604 
605  Param2DILocTy &getParamDbgMappings() { return ParamDbgMappings; }
606  ParamDecl2StmtTy &getCoroutineParameterMappings() {
607  return CoroutineParameterMappings;
608  }
609 
610 private:
611  /// Emit call to llvm.dbg.declare for a variable declaration.
612  /// Returns a pointer to the DILocalVariable associated with the
613  /// llvm.dbg.declare, or nullptr otherwise.
614  llvm::DILocalVariable *EmitDeclare(const VarDecl *decl, llvm::Value *AI,
615  std::optional<unsigned> ArgNo,
616  CGBuilderTy &Builder,
617  const bool UsePointerValue = false);
618 
619  /// Emit call to llvm.dbg.declare for a binding declaration.
620  /// Returns a pointer to the DILocalVariable associated with the
621  /// llvm.dbg.declare, or nullptr otherwise.
622  llvm::DILocalVariable *EmitDeclare(const BindingDecl *decl, llvm::Value *AI,
623  std::optional<unsigned> ArgNo,
624  CGBuilderTy &Builder,
625  const bool UsePointerValue = false);
626 
627  struct BlockByRefType {
628  /// The wrapper struct used inside the __block_literal struct.
629  llvm::DIType *BlockByRefWrapper;
630  /// The type as it appears in the source code.
631  llvm::DIType *WrappedType;
632  };
633 
634  bool HasReconstitutableArgs(ArrayRef<TemplateArgument> Args) const;
635  std::string GetName(const Decl *, bool Qualified = false) const;
636 
637  /// Build up structure info for the byref. See \a BuildByRefType.
638  BlockByRefType EmitTypeForVarWithBlocksAttr(const VarDecl *VD,
639  uint64_t *OffSet);
640 
641  /// Get context info for the DeclContext of \p Decl.
642  llvm::DIScope *getDeclContextDescriptor(const Decl *D);
643  /// Get context info for a given DeclContext \p Decl.
644  llvm::DIScope *getContextDescriptor(const Decl *Context,
645  llvm::DIScope *Default);
646 
647  llvm::DIScope *getCurrentContextDescriptor(const Decl *Decl);
648 
649  /// Create a forward decl for a RecordType in a given context.
650  llvm::DICompositeType *getOrCreateRecordFwdDecl(const RecordType *,
651  llvm::DIScope *);
652 
653  /// Return current directory name.
654  StringRef getCurrentDirname();
655 
656  /// Create new compile unit.
657  void CreateCompileUnit();
658 
659  /// Compute the file checksum debug info for input file ID.
660  std::optional<llvm::DIFile::ChecksumKind>
661  computeChecksum(FileID FID, SmallString<64> &Checksum) const;
662 
663  /// Get the source of the given file ID.
664  std::optional<StringRef> getSource(const SourceManager &SM, FileID FID);
665 
666  /// Convenience function to get the file debug info descriptor for the input
667  /// location.
668  llvm::DIFile *getOrCreateFile(SourceLocation Loc);
669 
670  /// Create a file debug info descriptor for a source file.
671  llvm::DIFile *
672  createFile(StringRef FileName,
673  std::optional<llvm::DIFile::ChecksumInfo<StringRef>> CSInfo,
674  std::optional<StringRef> Source);
675 
676  /// Get the type from the cache or create a new type if necessary.
677  llvm::DIType *getOrCreateType(QualType Ty, llvm::DIFile *Fg);
678 
679  /// Get a reference to a clang module. If \p CreateSkeletonCU is true,
680  /// this also creates a split dwarf skeleton compile unit.
681  llvm::DIModule *getOrCreateModuleRef(ASTSourceDescriptor Mod,
682  bool CreateSkeletonCU);
683 
684  /// DebugTypeExtRefs: If \p D originated in a clang module, return it.
685  llvm::DIModule *getParentModuleOrNull(const Decl *D);
686 
687  /// Get the type from the cache or create a new partial type if
688  /// necessary.
689  llvm::DICompositeType *getOrCreateLimitedType(const RecordType *Ty);
690 
691  /// Create type metadata for a source language type.
692  llvm::DIType *CreateTypeNode(QualType Ty, llvm::DIFile *Fg);
693 
694  /// Create new member and increase Offset by FType's size.
695  llvm::DIType *CreateMemberType(llvm::DIFile *Unit, QualType FType,
696  StringRef Name, uint64_t *Offset);
697 
698  /// Retrieve the DIDescriptor, if any, for the canonical form of this
699  /// declaration.
700  llvm::DINode *getDeclarationOrDefinition(const Decl *D);
701 
702  /// \return debug info descriptor to describe method
703  /// declaration for the given method definition.
704  llvm::DISubprogram *getFunctionDeclaration(const Decl *D);
705 
706  /// \return debug info descriptor to the describe method declaration
707  /// for the given method definition.
708  /// \param FnType For Objective-C methods, their type.
709  /// \param LineNo The declaration's line number.
710  /// \param Flags The DIFlags for the method declaration.
711  /// \param SPFlags The subprogram-spcific flags for the method declaration.
712  llvm::DISubprogram *
713  getObjCMethodDeclaration(const Decl *D, llvm::DISubroutineType *FnType,
714  unsigned LineNo, llvm::DINode::DIFlags Flags,
715  llvm::DISubprogram::DISPFlags SPFlags);
716 
717  /// \return debug info descriptor to describe in-class static data
718  /// member declaration for the given out-of-class definition. If D
719  /// is an out-of-class definition of a static data member of a
720  /// class, find its corresponding in-class declaration.
721  llvm::DIDerivedType *
722  getOrCreateStaticDataMemberDeclarationOrNull(const VarDecl *D);
723 
724  /// Helper that either creates a forward declaration or a stub.
725  llvm::DISubprogram *getFunctionFwdDeclOrStub(GlobalDecl GD, bool Stub);
726 
727  /// Create a subprogram describing the forward declaration
728  /// represented in the given FunctionDecl wrapped in a GlobalDecl.
729  llvm::DISubprogram *getFunctionForwardDeclaration(GlobalDecl GD);
730 
731  /// Create a DISubprogram describing the function
732  /// represented in the given FunctionDecl wrapped in a GlobalDecl.
733  llvm::DISubprogram *getFunctionStub(GlobalDecl GD);
734 
735  /// Create a global variable describing the forward declaration
736  /// represented in the given VarDecl.
737  llvm::DIGlobalVariable *
738  getGlobalVariableForwardDeclaration(const VarDecl *VD);
739 
740  /// Return a global variable that represents one of the collection of global
741  /// variables created for an anonmyous union.
742  ///
743  /// Recursively collect all of the member fields of a global
744  /// anonymous decl and create static variables for them. The first
745  /// time this is called it needs to be on a union and then from
746  /// there we can have additional unnamed fields.
747  llvm::DIGlobalVariableExpression *
748  CollectAnonRecordDecls(const RecordDecl *RD, llvm::DIFile *Unit,
749  unsigned LineNo, StringRef LinkageName,
750  llvm::GlobalVariable *Var, llvm::DIScope *DContext);
751 
752 
753  /// Return flags which enable debug info emission for call sites, provided
754  /// that it is supported and enabled.
755  llvm::DINode::DIFlags getCallSiteRelatedAttrs() const;
756 
757  /// Get the printing policy for producing names for debug info.
758  PrintingPolicy getPrintingPolicy() const;
759 
760  /// Get function name for the given FunctionDecl. If the name is
761  /// constructed on demand (e.g., C++ destructor) then the name is
762  /// stored on the side.
763  StringRef getFunctionName(const FunctionDecl *FD);
764 
765  /// Returns the unmangled name of an Objective-C method.
766  /// This is the display name for the debugging info.
767  StringRef getObjCMethodName(const ObjCMethodDecl *FD);
768 
769  /// Return selector name. This is used for debugging
770  /// info.
771  StringRef getSelectorName(Selector S);
772 
773  /// Get class name including template argument list.
774  StringRef getClassName(const RecordDecl *RD);
775 
776  /// Get the vtable name for the given class.
777  StringRef getVTableName(const CXXRecordDecl *Decl);
778 
779  /// Get the name to use in the debug info for a dynamic initializer or atexit
780  /// stub function.
781  StringRef getDynamicInitializerName(const VarDecl *VD,
782  DynamicInitKind StubKind,
783  llvm::Function *InitFn);
784 
785  /// Get line number for the location. If location is invalid
786  /// then use current location.
787  unsigned getLineNumber(SourceLocation Loc);
788 
789  /// Get column number for the location. If location is
790  /// invalid then use current location.
791  /// \param Force Assume DebugColumnInfo option is true.
792  unsigned getColumnNumber(SourceLocation Loc, bool Force = false);
793 
794  /// Collect various properties of a FunctionDecl.
795  /// \param GD A GlobalDecl whose getDecl() must return a FunctionDecl.
796  void collectFunctionDeclProps(GlobalDecl GD, llvm::DIFile *Unit,
797  StringRef &Name, StringRef &LinkageName,
798  llvm::DIScope *&FDContext,
799  llvm::DINodeArray &TParamsArray,
800  llvm::DINode::DIFlags &Flags);
801 
802  /// Collect various properties of a VarDecl.
803  void collectVarDeclProps(const VarDecl *VD, llvm::DIFile *&Unit,
804  unsigned &LineNo, QualType &T, StringRef &Name,
805  StringRef &LinkageName,
806  llvm::MDTuple *&TemplateParameters,
807  llvm::DIScope *&VDContext);
808 
809  /// Create a DIExpression representing the constant corresponding
810  /// to the specified 'Val'. Returns nullptr on failure.
811  llvm::DIExpression *createConstantValueExpression(const clang::ValueDecl *VD,
812  const APValue &Val);
813 
814  /// Allocate a copy of \p A using the DebugInfoNames allocator
815  /// and return a reference to it. If multiple arguments are given the strings
816  /// are concatenated.
817  StringRef internString(StringRef A, StringRef B = StringRef()) {
818  char *Data = DebugInfoNames.Allocate<char>(A.size() + B.size());
819  if (!A.empty())
820  std::memcpy(Data, A.data(), A.size());
821  if (!B.empty())
822  std::memcpy(Data + A.size(), B.data(), B.size());
823  return StringRef(Data, A.size() + B.size());
824  }
825 };
826 
827 /// A scoped helper to set the current debug location to the specified
828 /// location or preferred location of the specified Expr.
830 private:
831  void init(SourceLocation TemporaryLocation, bool DefaultToEmpty = false);
832  ApplyDebugLocation(CodeGenFunction &CGF, bool DefaultToEmpty,
833  SourceLocation TemporaryLocation);
834 
835  llvm::DebugLoc OriginalLocation;
836  CodeGenFunction *CGF;
837 
838 public:
839  /// Set the location to the (valid) TemporaryLocation.
840  ApplyDebugLocation(CodeGenFunction &CGF, SourceLocation TemporaryLocation);
841  ApplyDebugLocation(CodeGenFunction &CGF, const Expr *E);
842  ApplyDebugLocation(CodeGenFunction &CGF, llvm::DebugLoc Loc);
844  Other.CGF = nullptr;
845  }
846 
847  // Define copy assignment operator.
849  if (this != &Other) {
850  CGF = Other.CGF;
851  Other.CGF = nullptr;
852  }
853  return *this;
854  }
855 
857 
858  /// Apply TemporaryLocation if it is valid. Otherwise switch
859  /// to an artificial debug location that has a valid scope, but no
860  /// line information.
861  ///
862  /// Artificial locations are useful when emitting compiler-generated
863  /// helper functions that have no source location associated with
864  /// them. The DWARF specification allows the compiler to use the
865  /// special line number 0 to indicate code that can not be
866  /// attributed to any source location. Note that passing an empty
867  /// SourceLocation to CGDebugInfo::setLocation() will result in the
868  /// last valid location being reused.
870  return ApplyDebugLocation(CGF, false, SourceLocation());
871  }
872  /// Apply TemporaryLocation if it is valid. Otherwise switch
873  /// to an artificial debug location that has a valid scope, but no
874  /// line information.
875  static ApplyDebugLocation
877  SourceLocation TemporaryLocation) {
878  return ApplyDebugLocation(CGF, false, TemporaryLocation);
879  }
880 
881  /// Set the IRBuilder to not attach debug locations. Note that
882  /// passing an empty SourceLocation to \a CGDebugInfo::setLocation()
883  /// will result in the last valid location being reused. Note that
884  /// all instructions that do not have a location at the beginning of
885  /// a function are counted towards to function prologue.
887  return ApplyDebugLocation(CGF, true, SourceLocation());
888  }
889 };
890 
891 /// A scoped helper to set the current debug location to an inlined location.
893  SourceLocation SavedLocation;
894  CodeGenFunction *CGF;
895 
896 public:
897  /// Set up the CodeGenFunction's DebugInfo to produce inline locations for the
898  /// function \p InlinedFn. The current debug location becomes the inlined call
899  /// site of the inlined function.
901  /// Restore everything back to the original state.
903 };
904 
905 bool noSystemDebugInfo(const Decl *D, const CodeGenModule &CGM);
906 
907 } // namespace CodeGen
908 } // namespace clang
909 
910 #endif // LLVM_CLANG_LIB_CODEGEN_CGDEBUGINFO_H
NodeId Parent
Definition: ASTDiff.cpp:191
MatchType Type
static char ID
Definition: Arena.cpp:183
#define SM(sm)
Definition: Cuda.cpp:83
static llvm::SmallVector< TemplateArgument > GetTemplateArgs(const TemplateDecl *TD, const TemplateSpecializationType *Ty)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
unsigned Offset
Definition: Format.cpp:2978
Defines the clang::Module class, which describes a module in the source code.
SourceLocation Loc
Definition: SemaObjC.cpp:755
Defines the clang::SourceLocation class and associated facilities.
const char * Data
Allows QualTypes to be sorted and hence used in maps and sets.
TypePropertyCache< Private > Cache
Definition: Type.cpp:4438
C Language Family Type Representation.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Definition: APValue.h:122
Abstracts clang modules and precompiled header files and holds everything needed to generate debug in...
Definition: Module.h:874
A binding in a decomposition declaration.
Definition: DeclCXX.h:4107
Represents a C++ struct/union/class.
Definition: DeclCXX.h:258
llvm::iterator_range< base_class_const_iterator > base_class_const_range
Definition: DeclCXX.h:617
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 ...
Definition: CGDebugInfo.h:829
static ApplyDebugLocation CreateArtificial(CodeGenFunction &CGF)
Apply TemporaryLocation if it is valid.
Definition: CGDebugInfo.h:869
static ApplyDebugLocation CreateDefaultArtificial(CodeGenFunction &CGF, SourceLocation TemporaryLocation)
Apply TemporaryLocation if it is valid.
Definition: CGDebugInfo.h:876
ApplyDebugLocation(ApplyDebugLocation &&Other)
Definition: CGDebugInfo.h:843
ApplyDebugLocation & operator=(ApplyDebugLocation &&Other)
Definition: CGDebugInfo.h:848
static ApplyDebugLocation CreateEmpty(CodeGenFunction &CGF)
Set the IRBuilder to not attach debug locations.
Definition: CGDebugInfo.h:886
A scoped helper to set the current debug location to an inlined location.
Definition: CGDebugInfo.h:892
CGBlockInfo - Information to generate a block literal.
Definition: CGBlocks.h:156
This class gathers all debug information during compilation and is responsible for emitting to llvm g...
Definition: CGDebugInfo.h:55
Param2DILocTy & getParamDbgMappings()
Definition: CGDebugInfo.h:605
llvm::MDNode * getInlinedAt() const
Definition: CGDebugInfo.h:449
void setInlinedAt(llvm::MDNode *InlinedAt)
Update the current inline scope.
Definition: CGDebugInfo.h:446
SourceLocation getLocation() const
Return the current source location.
Definition: CGDebugInfo.h:442
ParamDecl2StmtTy & getCoroutineParameterMappings()
Definition: CGDebugInfo.h:606
void setModuleMap(ModuleMap &MMap)
When generating debug information for a clang module or precompiled header, this module map will be u...
Definition: CGDebugInfo.h:428
void setPCHDescriptor(ASTSourceDescriptor PCH)
When generating debug information for a clang module or precompiled header, this module map will be u...
Definition: CGDebugInfo.h:433
void registerVLASizeExpression(QualType Ty, llvm::Metadata *SizeExpr)
Register VLA size expression debug node with the qualified type.
Definition: CGDebugInfo.h:416
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.
Definition: DeclBase.h:86
Represents an enum.
Definition: Decl.h:3870
This represents one expression.
Definition: Expr.h:110
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Represents a function declaration or definition.
Definition: Decl.h:1972
GlobalDecl - represents a global declaration.
Definition: GlobalDecl.h:56
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Definition: Decl.h:4802
Represents the declaration of a label.
Definition: Decl.h:500
Represents a C++ namespace alias.
Definition: DeclCXX.h:3120
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:140
Callbacks to use to customize the behavior of the pretty-printer.
Definition: PrettyPrinter.h:32
A (possibly-)qualified type.
Definition: Type.h:940
Represents a struct/union/class.
Definition: Decl.h:4171
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:5561
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.
Definition: Expr.h:1773
Represents a C++ using-declaration.
Definition: DeclCXX.h:3512
Represents C++ using-directive.
Definition: DeclCXX.h:3015
Represents a C++ using-enum-declaration.
Definition: DeclCXX.h:3713
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition: DeclCXX.h:3320
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:707
Represents a variable declaration or definition.
Definition: Decl.h:919
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
bool noSystemDebugInfo(const Decl *D, const CodeGenModule &CGM)
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
static FormatToken * getFunctionName(const AnnotatedLine &Line)
void EmitLocation(raw_ostream &o, const SourceManager &SM, SourceLocation L, const FIDMap &FM, unsigned indent)
Definition: PlistSupport.h:106
RangeSelector name(std::string ID)
Given a node with a "name", (like NamedDecl, DeclRefExpr, CxxCtorInitializer, and TypeLoc) selects th...
The JSON file list parser is used to communicate input to InstallAPI.
DynamicInitKind
Definition: GlobalDecl.h:32
const FunctionProtoType * T
@ PCH
Disable validation for a precompiled header and the modules it depends on.
void finalize(TemplateInstantiationCallbackPtrs &Callbacks, const Sema &TheSema)
@ Other
Other implicit parameter.
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition: Specifiers.h:120
unsigned long uint64_t
Diagnostic wrappers for TextAPI types for error reporting.
Definition: Dominators.h:30
Describes how types, statements, expressions, and declarations should be printed.
Definition: PrettyPrinter.h:57