clang  17.0.0git
CodeGenModule.h
Go to the documentation of this file.
1 //===--- CodeGenModule.h - Per-Module state 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 internal per-translation-unit state used for llvm translation.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CLANG_LIB_CODEGEN_CODEGENMODULE_H
14 #define LLVM_CLANG_LIB_CODEGEN_CODEGENMODULE_H
15 
16 #include "CGVTables.h"
17 #include "CodeGenTypeCache.h"
18 #include "CodeGenTypes.h"
19 #include "SanitizerMetadata.h"
20 #include "clang/AST/DeclCXX.h"
21 #include "clang/AST/DeclObjC.h"
22 #include "clang/AST/DeclOpenMP.h"
23 #include "clang/AST/GlobalDecl.h"
24 #include "clang/AST/Mangle.h"
25 #include "clang/Basic/ABI.h"
27 #include "clang/Basic/Module.h"
29 #include "clang/Basic/TargetInfo.h"
30 #include "clang/Basic/XRayLists.h"
32 #include "llvm/ADT/DenseMap.h"
33 #include "llvm/ADT/SetVector.h"
34 #include "llvm/ADT/SmallPtrSet.h"
35 #include "llvm/ADT/StringMap.h"
36 #include "llvm/IR/Module.h"
37 #include "llvm/IR/ValueHandle.h"
38 #include "llvm/Transforms/Utils/SanitizerStats.h"
39 #include <optional>
40 
41 namespace llvm {
42 class Module;
43 class Constant;
44 class ConstantInt;
45 class Function;
46 class GlobalValue;
47 class DataLayout;
48 class FunctionType;
49 class LLVMContext;
50 class IndexedInstrProfReader;
51 
52 namespace vfs {
53 class FileSystem;
54 }
55 }
56 
57 namespace clang {
58 class ASTContext;
59 class AtomicType;
60 class FunctionDecl;
61 class IdentifierInfo;
62 class ObjCImplementationDecl;
63 class ObjCEncodeExpr;
64 class BlockExpr;
65 class CharUnits;
66 class Decl;
67 class Expr;
68 class Stmt;
69 class StringLiteral;
70 class NamedDecl;
71 class ValueDecl;
72 class VarDecl;
73 class LangOptions;
74 class CodeGenOptions;
75 class HeaderSearchOptions;
76 class DiagnosticsEngine;
77 class AnnotateAttr;
78 class CXXDestructorDecl;
79 class Module;
80 class CoverageSourceInfo;
81 class InitSegAttr;
82 
83 namespace CodeGen {
84 
85 class CodeGenFunction;
86 class CodeGenTBAA;
87 class CGCXXABI;
88 class CGDebugInfo;
89 class CGObjCRuntime;
90 class CGOpenCLRuntime;
91 class CGOpenMPRuntime;
92 class CGCUDARuntime;
93 class CGHLSLRuntime;
94 class CoverageMappingModuleGen;
95 class TargetCodeGenInfo;
96 
97 enum ForDefinition_t : bool {
100 };
101 
103  unsigned int priority;
104  unsigned int lex_order;
105  OrderGlobalInitsOrStermFinalizers(unsigned int p, unsigned int l)
106  : priority(p), lex_order(l) {}
107 
109  return priority == RHS.priority && lex_order == RHS.lex_order;
110  }
111 
113  return std::tie(priority, lex_order) <
114  std::tie(RHS.priority, RHS.lex_order);
115  }
116 };
117 
119  ObjCEntrypoints() { memset(this, 0, sizeof(*this)); }
120 
121  /// void objc_alloc(id);
122  llvm::FunctionCallee objc_alloc;
123 
124  /// void objc_allocWithZone(id);
125  llvm::FunctionCallee objc_allocWithZone;
126 
127  /// void objc_alloc_init(id);
128  llvm::FunctionCallee objc_alloc_init;
129 
130  /// void objc_autoreleasePoolPop(void*);
131  llvm::FunctionCallee objc_autoreleasePoolPop;
132 
133  /// void objc_autoreleasePoolPop(void*);
134  /// Note this method is used when we are using exception handling
135  llvm::FunctionCallee objc_autoreleasePoolPopInvoke;
136 
137  /// void *objc_autoreleasePoolPush(void);
138  llvm::Function *objc_autoreleasePoolPush;
139 
140  /// id objc_autorelease(id);
141  llvm::Function *objc_autorelease;
142 
143  /// id objc_autorelease(id);
144  /// Note this is the runtime method not the intrinsic.
145  llvm::FunctionCallee objc_autoreleaseRuntimeFunction;
146 
147  /// id objc_autoreleaseReturnValue(id);
149 
150  /// void objc_copyWeak(id *dest, id *src);
151  llvm::Function *objc_copyWeak;
152 
153  /// void objc_destroyWeak(id*);
154  llvm::Function *objc_destroyWeak;
155 
156  /// id objc_initWeak(id*, id);
157  llvm::Function *objc_initWeak;
158 
159  /// id objc_loadWeak(id*);
160  llvm::Function *objc_loadWeak;
161 
162  /// id objc_loadWeakRetained(id*);
163  llvm::Function *objc_loadWeakRetained;
164 
165  /// void objc_moveWeak(id *dest, id *src);
166  llvm::Function *objc_moveWeak;
167 
168  /// id objc_retain(id);
169  llvm::Function *objc_retain;
170 
171  /// id objc_retain(id);
172  /// Note this is the runtime method not the intrinsic.
173  llvm::FunctionCallee objc_retainRuntimeFunction;
174 
175  /// id objc_retainAutorelease(id);
176  llvm::Function *objc_retainAutorelease;
177 
178  /// id objc_retainAutoreleaseReturnValue(id);
180 
181  /// id objc_retainAutoreleasedReturnValue(id);
183 
184  /// id objc_retainBlock(id);
185  llvm::Function *objc_retainBlock;
186 
187  /// void objc_release(id);
188  llvm::Function *objc_release;
189 
190  /// void objc_release(id);
191  /// Note this is the runtime method not the intrinsic.
192  llvm::FunctionCallee objc_releaseRuntimeFunction;
193 
194  /// void objc_storeStrong(id*, id);
195  llvm::Function *objc_storeStrong;
196 
197  /// id objc_storeWeak(id*, id);
198  llvm::Function *objc_storeWeak;
199 
200  /// id objc_unsafeClaimAutoreleasedReturnValue(id);
202 
203  /// A void(void) inline asm to use to mark that the return value of
204  /// a call will be immediately retain.
206 
207  /// void clang.arc.use(...);
208  llvm::Function *clang_arc_use;
209 
210  /// void clang.arc.noop.use(...);
211  llvm::Function *clang_arc_noop_use;
212 };
213 
214 /// This class records statistics on instrumentation based profiling.
216  uint32_t VisitedInMainFile;
217  uint32_t MissingInMainFile;
218  uint32_t Visited;
219  uint32_t Missing;
220  uint32_t Mismatched;
221 
222 public:
224  : VisitedInMainFile(0), MissingInMainFile(0), Visited(0), Missing(0),
225  Mismatched(0) {}
226  /// Record that we've visited a function and whether or not that function was
227  /// in the main source file.
228  void addVisited(bool MainFile) {
229  if (MainFile)
230  ++VisitedInMainFile;
231  ++Visited;
232  }
233  /// Record that a function we've visited has no profile data.
234  void addMissing(bool MainFile) {
235  if (MainFile)
236  ++MissingInMainFile;
237  ++Missing;
238  }
239  /// Record that a function we've visited has mismatched profile data.
240  void addMismatched(bool MainFile) { ++Mismatched; }
241  /// Whether or not the stats we've gathered indicate any potential problems.
242  bool hasDiagnostics() { return Missing || Mismatched; }
243  /// Report potential problems we've found to \c Diags.
244  void reportDiagnostics(DiagnosticsEngine &Diags, StringRef MainFile);
245 };
246 
247 /// A pair of helper functions for a __block variable.
248 class BlockByrefHelpers : public llvm::FoldingSetNode {
249  // MSVC requires this type to be complete in order to process this
250  // header.
251 public:
252  llvm::Constant *CopyHelper;
253  llvm::Constant *DisposeHelper;
254 
255  /// The alignment of the field. This is important because
256  /// different offsets to the field within the byref struct need to
257  /// have different helper functions.
259 
261  : CopyHelper(nullptr), DisposeHelper(nullptr), Alignment(alignment) {}
262  BlockByrefHelpers(const BlockByrefHelpers &) = default;
263  virtual ~BlockByrefHelpers();
264 
265  void Profile(llvm::FoldingSetNodeID &id) const {
266  id.AddInteger(Alignment.getQuantity());
267  profileImpl(id);
268  }
269  virtual void profileImpl(llvm::FoldingSetNodeID &id) const = 0;
270 
271  virtual bool needsCopy() const { return true; }
272  virtual void emitCopy(CodeGenFunction &CGF, Address dest, Address src) = 0;
273 
274  virtual bool needsDispose() const { return true; }
275  virtual void emitDispose(CodeGenFunction &CGF, Address field) = 0;
276 };
277 
278 /// This class organizes the cross-function state that is used while generating
279 /// LLVM code.
281  CodeGenModule(const CodeGenModule &) = delete;
282  void operator=(const CodeGenModule &) = delete;
283 
284 public:
285  struct Structor {
287  : Priority(0), LexOrder(~0u), Initializer(nullptr),
288  AssociatedData(nullptr) {}
289  Structor(int Priority, unsigned LexOrder, llvm::Constant *Initializer,
290  llvm::Constant *AssociatedData)
293  int Priority;
294  unsigned LexOrder;
295  llvm::Constant *Initializer;
296  llvm::Constant *AssociatedData;
297  };
298 
299  typedef std::vector<Structor> CtorList;
300 
301 private:
302  ASTContext &Context;
303  const LangOptions &LangOpts;
304  IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS; // Only used for debug info.
305  const HeaderSearchOptions &HeaderSearchOpts; // Only used for debug info.
306  const PreprocessorOptions &PreprocessorOpts; // Only used for debug info.
307  const CodeGenOptions &CodeGenOpts;
308  unsigned NumAutoVarInit = 0;
309  llvm::Module &TheModule;
310  DiagnosticsEngine &Diags;
311  const TargetInfo &Target;
312  std::unique_ptr<CGCXXABI> ABI;
313  llvm::LLVMContext &VMContext;
314  std::string ModuleNameHash;
315  bool CXX20ModuleInits = false;
316  std::unique_ptr<CodeGenTBAA> TBAA;
317 
318  mutable std::unique_ptr<TargetCodeGenInfo> TheTargetCodeGenInfo;
319 
320  // This should not be moved earlier, since its initialization depends on some
321  // of the previous reference members being already initialized and also checks
322  // if TheTargetCodeGenInfo is NULL
323  CodeGenTypes Types;
324 
325  /// Holds information about C++ vtables.
326  CodeGenVTables VTables;
327 
328  std::unique_ptr<CGObjCRuntime> ObjCRuntime;
329  std::unique_ptr<CGOpenCLRuntime> OpenCLRuntime;
330  std::unique_ptr<CGOpenMPRuntime> OpenMPRuntime;
331  std::unique_ptr<CGCUDARuntime> CUDARuntime;
332  std::unique_ptr<CGHLSLRuntime> HLSLRuntime;
333  std::unique_ptr<CGDebugInfo> DebugInfo;
334  std::unique_ptr<ObjCEntrypoints> ObjCData;
335  llvm::MDNode *NoObjCARCExceptionsMetadata = nullptr;
336  std::unique_ptr<llvm::IndexedInstrProfReader> PGOReader;
337  InstrProfStats PGOStats;
338  std::unique_ptr<llvm::SanitizerStatReport> SanStats;
339 
340  // A set of references that have only been seen via a weakref so far. This is
341  // used to remove the weak of the reference if we ever see a direct reference
342  // or a definition.
344 
345  /// This contains all the decls which have definitions but/ which are deferred
346  /// for emission and therefore should only be output if they are actually
347  /// used. If a decl is in this, then it is known to have not been referenced
348  /// yet.
349  llvm::DenseMap<StringRef, GlobalDecl> DeferredDecls;
350 
351  /// This is a list of deferred decls which we have seen that *are* actually
352  /// referenced. These get code generated when the module is done.
353  std::vector<GlobalDecl> DeferredDeclsToEmit;
354  void addDeferredDeclToEmit(GlobalDecl GD) {
355  DeferredDeclsToEmit.emplace_back(GD);
356  addEmittedDeferredDecl(GD);
357  }
358 
359  /// Decls that were DeferredDecls and have now been emitted.
360  llvm::DenseMap<llvm::StringRef, GlobalDecl> EmittedDeferredDecls;
361 
362  void addEmittedDeferredDecl(GlobalDecl GD) {
363  if (!llvm::isa<FunctionDecl>(GD.getDecl()))
364  return;
365  llvm::GlobalVariable::LinkageTypes L = getFunctionLinkage(GD);
366  if (llvm::GlobalValue::isLinkOnceLinkage(L) ||
367  llvm::GlobalValue::isWeakLinkage(L)) {
368  EmittedDeferredDecls[getMangledName(GD)] = GD;
369  }
370  }
371 
372  /// List of alias we have emitted. Used to make sure that what they point to
373  /// is defined once we get to the end of the of the translation unit.
374  std::vector<GlobalDecl> Aliases;
375 
376  /// List of multiversion functions to be emitted. This list is processed in
377  /// conjunction with other deferred symbols and is used to ensure that
378  /// multiversion function resolvers and ifuncs are defined and emitted.
379  std::vector<GlobalDecl> MultiVersionFuncs;
380 
381  typedef llvm::StringMap<llvm::TrackingVH<llvm::Constant> > ReplacementsTy;
382  ReplacementsTy Replacements;
383 
384  /// List of global values to be replaced with something else. Used when we
385  /// want to replace a GlobalValue but can't identify it by its mangled name
386  /// anymore (because the name is already taken).
388  GlobalValReplacements;
389 
390  /// Variables for which we've emitted globals containing their constant
391  /// values along with the corresponding globals, for opportunistic reuse.
392  llvm::DenseMap<const VarDecl*, llvm::GlobalVariable*> InitializerConstants;
393 
394  /// Set of global decls for which we already diagnosed mangled name conflict.
395  /// Required to not issue a warning (on a mangling conflict) multiple times
396  /// for the same decl.
397  llvm::DenseSet<GlobalDecl> DiagnosedConflictingDefinitions;
398 
399  /// A queue of (optional) vtables to consider emitting.
400  std::vector<const CXXRecordDecl*> DeferredVTables;
401 
402  /// A queue of (optional) vtables that may be emitted opportunistically.
403  std::vector<const CXXRecordDecl *> OpportunisticVTables;
404 
405  /// List of global values which are required to be present in the object file;
406  /// bitcast to i8*. This is used for forcing visibility of symbols which may
407  /// otherwise be optimized out.
408  std::vector<llvm::WeakTrackingVH> LLVMUsed;
409  std::vector<llvm::WeakTrackingVH> LLVMCompilerUsed;
410 
411  /// Store the list of global constructors and their respective priorities to
412  /// be emitted when the translation unit is complete.
413  CtorList GlobalCtors;
414 
415  /// Store the list of global destructors and their respective priorities to be
416  /// emitted when the translation unit is complete.
417  CtorList GlobalDtors;
418 
419  /// An ordered map of canonical GlobalDecls to their mangled names.
420  llvm::MapVector<GlobalDecl, StringRef> MangledDeclNames;
421  llvm::StringMap<GlobalDecl, llvm::BumpPtrAllocator> Manglings;
422 
423  /// Global annotations.
424  std::vector<llvm::Constant*> Annotations;
425 
426  /// Map used to get unique annotation strings.
427  llvm::StringMap<llvm::Constant*> AnnotationStrings;
428 
429  /// Used for uniquing of annotation arguments.
430  llvm::DenseMap<unsigned, llvm::Constant *> AnnotationArgs;
431 
432  llvm::StringMap<llvm::GlobalVariable *> CFConstantStringMap;
433 
434  llvm::DenseMap<llvm::Constant *, llvm::GlobalVariable *> ConstantStringMap;
435  llvm::DenseMap<const UnnamedGlobalConstantDecl *, llvm::GlobalVariable *>
436  UnnamedGlobalConstantDeclMap;
437  llvm::DenseMap<const Decl*, llvm::Constant *> StaticLocalDeclMap;
438  llvm::DenseMap<const Decl*, llvm::GlobalVariable*> StaticLocalDeclGuardMap;
439  llvm::DenseMap<const Expr*, llvm::Constant *> MaterializedGlobalTemporaryMap;
440 
441  llvm::DenseMap<QualType, llvm::Constant *> AtomicSetterHelperFnMap;
442  llvm::DenseMap<QualType, llvm::Constant *> AtomicGetterHelperFnMap;
443 
444  /// Map used to get unique type descriptor constants for sanitizers.
445  llvm::DenseMap<QualType, llvm::Constant *> TypeDescriptorMap;
446 
447  /// Map used to track internal linkage functions declared within
448  /// extern "C" regions.
449  typedef llvm::MapVector<IdentifierInfo *,
450  llvm::GlobalValue *> StaticExternCMap;
451  StaticExternCMap StaticExternCValues;
452 
453  /// thread_local variables defined or used in this TU.
454  std::vector<const VarDecl *> CXXThreadLocals;
455 
456  /// thread_local variables with initializers that need to run
457  /// before any thread_local variable in this TU is odr-used.
458  std::vector<llvm::Function *> CXXThreadLocalInits;
459  std::vector<const VarDecl *> CXXThreadLocalInitVars;
460 
461  /// Global variables with initializers that need to run before main.
462  std::vector<llvm::Function *> CXXGlobalInits;
463 
464  /// When a C++ decl with an initializer is deferred, null is
465  /// appended to CXXGlobalInits, and the index of that null is placed
466  /// here so that the initializer will be performed in the correct
467  /// order. Once the decl is emitted, the index is replaced with ~0U to ensure
468  /// that we don't re-emit the initializer.
469  llvm::DenseMap<const Decl*, unsigned> DelayedCXXInitPosition;
470 
471  typedef std::pair<OrderGlobalInitsOrStermFinalizers, llvm::Function *>
472  GlobalInitData;
473 
474  struct GlobalInitPriorityCmp {
475  bool operator()(const GlobalInitData &LHS,
476  const GlobalInitData &RHS) const {
477  return LHS.first.priority < RHS.first.priority;
478  }
479  };
480 
481  /// Global variables with initializers whose order of initialization is set by
482  /// init_priority attribute.
483  SmallVector<GlobalInitData, 8> PrioritizedCXXGlobalInits;
484 
485  /// Global destructor functions and arguments that need to run on termination.
486  /// When UseSinitAndSterm is set, it instead contains sterm finalizer
487  /// functions, which also run on unloading a shared library.
488  typedef std::tuple<llvm::FunctionType *, llvm::WeakTrackingVH,
489  llvm::Constant *>
490  CXXGlobalDtorsOrStermFinalizer_t;
491  SmallVector<CXXGlobalDtorsOrStermFinalizer_t, 8>
492  CXXGlobalDtorsOrStermFinalizers;
493 
494  typedef std::pair<OrderGlobalInitsOrStermFinalizers, llvm::Function *>
495  StermFinalizerData;
496 
497  struct StermFinalizerPriorityCmp {
498  bool operator()(const StermFinalizerData &LHS,
499  const StermFinalizerData &RHS) const {
500  return LHS.first.priority < RHS.first.priority;
501  }
502  };
503 
504  /// Global variables with sterm finalizers whose order of initialization is
505  /// set by init_priority attribute.
506  SmallVector<StermFinalizerData, 8> PrioritizedCXXStermFinalizers;
507 
508  /// The complete set of modules that has been imported.
509  llvm::SetVector<clang::Module *> ImportedModules;
510 
511  /// The set of modules for which the module initializers
512  /// have been emitted.
513  llvm::SmallPtrSet<clang::Module *, 16> EmittedModuleInitializers;
514 
515  /// A vector of metadata strings for linker options.
516  SmallVector<llvm::MDNode *, 16> LinkerOptionsMetadata;
517 
518  /// A vector of metadata strings for dependent libraries for ELF.
519  SmallVector<llvm::MDNode *, 16> ELFDependentLibraries;
520 
521  /// @name Cache for Objective-C runtime types
522  /// @{
523 
524  /// Cached reference to the class for constant strings. This value has type
525  /// int * but is actually an Obj-C class pointer.
526  llvm::WeakTrackingVH CFConstantStringClassRef;
527 
528  /// The type used to describe the state of a fast enumeration in
529  /// Objective-C's for..in loop.
530  QualType ObjCFastEnumerationStateType;
531 
532  /// @}
533 
534  /// Lazily create the Objective-C runtime
535  void createObjCRuntime();
536 
537  void createOpenCLRuntime();
538  void createOpenMPRuntime();
539  void createCUDARuntime();
540  void createHLSLRuntime();
541 
542  bool isTriviallyRecursive(const FunctionDecl *F);
543  bool shouldEmitFunction(GlobalDecl GD);
544  bool shouldOpportunisticallyEmitVTables();
545  /// Map used to be sure we don't emit the same CompoundLiteral twice.
546  llvm::DenseMap<const CompoundLiteralExpr *, llvm::GlobalVariable *>
547  EmittedCompoundLiterals;
548 
549  /// Map of the global blocks we've emitted, so that we don't have to re-emit
550  /// them if the constexpr evaluator gets aggressive.
551  llvm::DenseMap<const BlockExpr *, llvm::Constant *> EmittedGlobalBlocks;
552 
553  /// @name Cache for Blocks Runtime Globals
554  /// @{
555 
556  llvm::Constant *NSConcreteGlobalBlock = nullptr;
557  llvm::Constant *NSConcreteStackBlock = nullptr;
558 
559  llvm::FunctionCallee BlockObjectAssign = nullptr;
560  llvm::FunctionCallee BlockObjectDispose = nullptr;
561 
562  llvm::Type *BlockDescriptorType = nullptr;
563  llvm::Type *GenericBlockLiteralType = nullptr;
564 
565  struct {
567  } Block;
568 
569  GlobalDecl initializedGlobalDecl;
570 
571  /// @}
572 
573  /// void @llvm.lifetime.start(i64 %size, i8* nocapture <ptr>)
574  llvm::Function *LifetimeStartFn = nullptr;
575 
576  /// void @llvm.lifetime.end(i64 %size, i8* nocapture <ptr>)
577  llvm::Function *LifetimeEndFn = nullptr;
578 
579  std::unique_ptr<SanitizerMetadata> SanitizerMD;
580 
581  llvm::MapVector<const Decl *, bool> DeferredEmptyCoverageMappingDecls;
582 
583  std::unique_ptr<CoverageMappingModuleGen> CoverageMapping;
584 
585  /// Mapping from canonical types to their metadata identifiers. We need to
586  /// maintain this mapping because identifiers may be formed from distinct
587  /// MDNodes.
588  typedef llvm::DenseMap<QualType, llvm::Metadata *> MetadataTypeMap;
589  MetadataTypeMap MetadataIdMap;
590  MetadataTypeMap VirtualMetadataIdMap;
591  MetadataTypeMap GeneralizedMetadataIdMap;
592 
593  llvm::DenseMap<const llvm::Constant *, llvm::GlobalVariable *> RTTIProxyMap;
594 
595  // Helps squashing blocks of TopLevelStmtDecl into a single llvm::Function
596  // when used with -fincremental-extensions.
597  std::pair<std::unique_ptr<CodeGenFunction>, const TopLevelStmtDecl *>
598  GlobalTopLevelStmtBlockInFlight;
599 
600 public:
602  const HeaderSearchOptions &headersearchopts,
603  const PreprocessorOptions &ppopts,
604  const CodeGenOptions &CodeGenOpts, llvm::Module &M,
605  DiagnosticsEngine &Diags,
606  CoverageSourceInfo *CoverageInfo = nullptr);
607 
608  ~CodeGenModule();
609 
610  void clear();
611 
612  /// Finalize LLVM code generation.
613  void Release();
614 
615  /// Return true if we should emit location information for expressions.
616  bool getExpressionLocationsEnabled() const;
617 
618  /// Return a reference to the configured Objective-C runtime.
620  if (!ObjCRuntime) createObjCRuntime();
621  return *ObjCRuntime;
622  }
623 
624  /// Return true iff an Objective-C runtime has been configured.
625  bool hasObjCRuntime() { return !!ObjCRuntime; }
626 
627  const std::string &getModuleNameHash() const { return ModuleNameHash; }
628 
629  /// Return a reference to the configured OpenCL runtime.
631  assert(OpenCLRuntime != nullptr);
632  return *OpenCLRuntime;
633  }
634 
635  /// Return a reference to the configured OpenMP runtime.
637  assert(OpenMPRuntime != nullptr);
638  return *OpenMPRuntime;
639  }
640 
641  /// Return a reference to the configured CUDA runtime.
643  assert(CUDARuntime != nullptr);
644  return *CUDARuntime;
645  }
646 
647  /// Return a reference to the configured HLSL runtime.
649  assert(HLSLRuntime != nullptr);
650  return *HLSLRuntime;
651  }
652 
654  assert(ObjCData != nullptr);
655  return *ObjCData;
656  }
657 
658  // Version checking functions, used to implement ObjC's @available:
659  // i32 @__isOSVersionAtLeast(i32, i32, i32)
660  llvm::FunctionCallee IsOSVersionAtLeastFn = nullptr;
661  // i32 @__isPlatformVersionAtLeast(i32, i32, i32, i32)
662  llvm::FunctionCallee IsPlatformVersionAtLeastFn = nullptr;
663 
664  InstrProfStats &getPGOStats() { return PGOStats; }
665  llvm::IndexedInstrProfReader *getPGOReader() const { return PGOReader.get(); }
666 
668  return CoverageMapping.get();
669  }
670 
671  llvm::Constant *getStaticLocalDeclAddress(const VarDecl *D) {
672  return StaticLocalDeclMap[D];
673  }
675  llvm::Constant *C) {
676  StaticLocalDeclMap[D] = C;
677  }
678 
679  llvm::Constant *
681  llvm::GlobalValue::LinkageTypes Linkage);
682 
683  llvm::GlobalVariable *getStaticLocalDeclGuardAddress(const VarDecl *D) {
684  return StaticLocalDeclGuardMap[D];
685  }
687  llvm::GlobalVariable *C) {
688  StaticLocalDeclGuardMap[D] = C;
689  }
690 
691  Address createUnnamedGlobalFrom(const VarDecl &D, llvm::Constant *Constant,
692  CharUnits Align);
693 
694  bool lookupRepresentativeDecl(StringRef MangledName,
695  GlobalDecl &Result) const;
696 
697  llvm::Constant *getAtomicSetterHelperFnMap(QualType Ty) {
698  return AtomicSetterHelperFnMap[Ty];
699  }
701  llvm::Constant *Fn) {
702  AtomicSetterHelperFnMap[Ty] = Fn;
703  }
704 
705  llvm::Constant *getAtomicGetterHelperFnMap(QualType Ty) {
706  return AtomicGetterHelperFnMap[Ty];
707  }
709  llvm::Constant *Fn) {
710  AtomicGetterHelperFnMap[Ty] = Fn;
711  }
712 
713  llvm::Constant *getTypeDescriptorFromMap(QualType Ty) {
714  return TypeDescriptorMap[Ty];
715  }
716  void setTypeDescriptorInMap(QualType Ty, llvm::Constant *C) {
717  TypeDescriptorMap[Ty] = C;
718  }
719 
720  CGDebugInfo *getModuleDebugInfo() { return DebugInfo.get(); }
721 
723  if (!NoObjCARCExceptionsMetadata)
724  NoObjCARCExceptionsMetadata =
725  llvm::MDNode::get(getLLVMContext(), std::nullopt);
726  return NoObjCARCExceptionsMetadata;
727  }
728 
729  ASTContext &getContext() const { return Context; }
730  const LangOptions &getLangOpts() const { return LangOpts; }
732  return FS;
733  }
735  const { return HeaderSearchOpts; }
737  const { return PreprocessorOpts; }
738  const CodeGenOptions &getCodeGenOpts() const { return CodeGenOpts; }
739  llvm::Module &getModule() const { return TheModule; }
740  DiagnosticsEngine &getDiags() const { return Diags; }
741  const llvm::DataLayout &getDataLayout() const {
742  return TheModule.getDataLayout();
743  }
744  const TargetInfo &getTarget() const { return Target; }
745  const llvm::Triple &getTriple() const { return Target.getTriple(); }
746  bool supportsCOMDAT() const;
747  void maybeSetTrivialComdat(const Decl &D, llvm::GlobalObject &GO);
748 
749  CGCXXABI &getCXXABI() const { return *ABI; }
750  llvm::LLVMContext &getLLVMContext() { return VMContext; }
751 
752  bool shouldUseTBAA() const { return TBAA != nullptr; }
753 
755 
756  CodeGenTypes &getTypes() { return Types; }
757 
758  CodeGenVTables &getVTables() { return VTables; }
759 
761  return VTables.getItaniumVTableContext();
762  }
763 
765  return VTables.getItaniumVTableContext();
766  }
767 
769  return VTables.getMicrosoftVTableContext();
770  }
771 
772  CtorList &getGlobalCtors() { return GlobalCtors; }
773  CtorList &getGlobalDtors() { return GlobalDtors; }
774 
775  /// getTBAATypeInfo - Get metadata used to describe accesses to objects of
776  /// the given type.
777  llvm::MDNode *getTBAATypeInfo(QualType QTy);
778 
779  /// getTBAAAccessInfo - Get TBAA information that describes an access to
780  /// an object of the given type.
782 
783  /// getTBAAVTablePtrAccessInfo - Get the TBAA information that describes an
784  /// access to a virtual table pointer.
785  TBAAAccessInfo getTBAAVTablePtrAccessInfo(llvm::Type *VTablePtrType);
786 
787  llvm::MDNode *getTBAAStructInfo(QualType QTy);
788 
789  /// getTBAABaseTypeInfo - Get metadata that describes the given base access
790  /// type. Return null if the type is not suitable for use in TBAA access tags.
791  llvm::MDNode *getTBAABaseTypeInfo(QualType QTy);
792 
793  /// getTBAAAccessTagInfo - Get TBAA tag for a given memory access.
794  llvm::MDNode *getTBAAAccessTagInfo(TBAAAccessInfo Info);
795 
796  /// mergeTBAAInfoForCast - Get merged TBAA information for the purposes of
797  /// type casts.
800 
801  /// mergeTBAAInfoForConditionalOperator - Get merged TBAA information for the
802  /// purposes of conditional operator.
804  TBAAAccessInfo InfoB);
805 
806  /// mergeTBAAInfoForMemoryTransfer - Get merged TBAA information for the
807  /// purposes of memory transfer calls.
809  TBAAAccessInfo SrcInfo);
810 
811  /// getTBAAInfoForSubobject - Get TBAA information for an access with a given
812  /// base lvalue.
814  if (Base.getTBAAInfo().isMayAlias())
816  return getTBAAAccessInfo(AccessType);
817  }
818 
819  bool isTypeConstant(QualType QTy, bool ExcludeCtorDtor);
820 
822  bool isPaddedAtomicType(const AtomicType *type);
823 
824  /// DecorateInstructionWithTBAA - Decorate the instruction with a TBAA tag.
825  void DecorateInstructionWithTBAA(llvm::Instruction *Inst,
826  TBAAAccessInfo TBAAInfo);
827 
828  /// Adds !invariant.barrier !tag to instruction
829  void DecorateInstructionWithInvariantGroup(llvm::Instruction *I,
830  const CXXRecordDecl *RD);
831 
832  /// Emit the given number of characters as a value of type size_t.
833  llvm::ConstantInt *getSize(CharUnits numChars);
834 
835  /// Set the visibility for the given LLVM GlobalValue.
836  void setGlobalVisibility(llvm::GlobalValue *GV, const NamedDecl *D) const;
837 
838  void setDSOLocal(llvm::GlobalValue *GV) const;
839 
847  }
848  void setDLLImportDLLExport(llvm::GlobalValue *GV, GlobalDecl D) const;
849  void setDLLImportDLLExport(llvm::GlobalValue *GV, const NamedDecl *D) const;
850  /// Set visibility, dllimport/dllexport and dso_local.
851  /// This must be called after dllimport/dllexport is set.
852  void setGVProperties(llvm::GlobalValue *GV, GlobalDecl GD) const;
853  void setGVProperties(llvm::GlobalValue *GV, const NamedDecl *D) const;
854 
855  void setGVPropertiesAux(llvm::GlobalValue *GV, const NamedDecl *D) const;
856 
857  /// Set the TLS mode for the given LLVM GlobalValue for the thread-local
858  /// variable declaration D.
859  void setTLSMode(llvm::GlobalValue *GV, const VarDecl &D) const;
860 
861  /// Get LLVM TLS mode from CodeGenOptions.
862  llvm::GlobalVariable::ThreadLocalMode GetDefaultLLVMTLSModel() const;
863 
864  static llvm::GlobalValue::VisibilityTypes GetLLVMVisibility(Visibility V) {
865  switch (V) {
869  }
870  llvm_unreachable("unknown visibility!");
871  }
872 
873  llvm::Constant *GetAddrOfGlobal(GlobalDecl GD,
874  ForDefinition_t IsForDefinition
875  = NotForDefinition);
876 
877  /// Will return a global variable of the given type. If a variable with a
878  /// different type already exists then a new variable with the right type
879  /// will be created and all uses of the old variable will be replaced with a
880  /// bitcast to the new variable.
881  llvm::GlobalVariable *
882  CreateOrReplaceCXXRuntimeVariable(StringRef Name, llvm::Type *Ty,
883  llvm::GlobalValue::LinkageTypes Linkage,
884  llvm::Align Alignment);
885 
886  llvm::Function *CreateGlobalInitOrCleanUpFunction(
887  llvm::FunctionType *ty, const Twine &name, const CGFunctionInfo &FI,
888  SourceLocation Loc = SourceLocation(), bool TLS = false,
889  llvm::GlobalVariable::LinkageTypes Linkage =
891 
892  /// Return the AST address space of the underlying global variable for D, as
893  /// determined by its declaration. Normally this is the same as the address
894  /// space of D's type, but in CUDA, address spaces are associated with
895  /// declarations, not types. If D is nullptr, return the default address
896  /// space for global variable.
897  ///
898  /// For languages without explicit address spaces, if D has default address
899  /// space, target-specific global or constant address space may be returned.
901 
902  /// Return the AST address space of constant literal, which is used to emit
903  /// the constant literal as global variable in LLVM IR.
904  /// Note: This is not necessarily the address space of the constant literal
905  /// in AST. For address space agnostic language, e.g. C++, constant literal
906  /// in AST is always in default address space.
908 
909  /// Return the llvm::Constant for the address of the given global variable.
910  /// If Ty is non-null and if the global doesn't exist, then it will be created
911  /// with the specified type instead of whatever the normal requested type
912  /// would be. If IsForDefinition is true, it is guaranteed that an actual
913  /// global with type Ty will be returned, not conversion of a variable with
914  /// the same mangled name but some other type.
915  llvm::Constant *GetAddrOfGlobalVar(const VarDecl *D,
916  llvm::Type *Ty = nullptr,
917  ForDefinition_t IsForDefinition
918  = NotForDefinition);
919 
920  /// Return the address of the given function. If Ty is non-null, then this
921  /// function will use the specified type if it has to create it.
922  llvm::Constant *GetAddrOfFunction(GlobalDecl GD, llvm::Type *Ty = nullptr,
923  bool ForVTable = false,
924  bool DontDefer = false,
925  ForDefinition_t IsForDefinition
926  = NotForDefinition);
927 
928  // Return the function body address of the given function.
929  llvm::Constant *GetFunctionStart(const ValueDecl *Decl);
930 
931  /// Get the address of the RTTI descriptor for the given type.
932  llvm::Constant *GetAddrOfRTTIDescriptor(QualType Ty, bool ForEH = false);
933 
934  /// Get the address of a GUID.
936 
937  /// Get the address of a UnnamedGlobalConstant
940 
941  /// Get the address of a template parameter object.
944 
945  /// Get the address of the thunk for the given global decl.
946  llvm::Constant *GetAddrOfThunk(StringRef Name, llvm::Type *FnTy,
947  GlobalDecl GD);
948 
949  /// Get a reference to the target of VD.
951 
952  /// Returns the assumed alignment of an opaque pointer to the given class.
954 
955  /// Returns the minimum object size for an object of the given class type
956  /// (or a class derived from it).
958 
959  /// Returns the minimum object size for an object of the given type.
961  if (CXXRecordDecl *RD = Ty->getAsCXXRecordDecl())
962  return getMinimumClassObjectSize(RD);
963  return getContext().getTypeSizeInChars(Ty);
964  }
965 
966  /// Returns the assumed alignment of a virtual base of a class.
968  const CXXRecordDecl *Derived,
969  const CXXRecordDecl *VBase);
970 
971  /// Given a class pointer with an actual known alignment, and the
972  /// expected alignment of an object at a dynamic offset w.r.t that
973  /// pointer, return the alignment to assume at the offset.
975  const CXXRecordDecl *Class,
976  CharUnits ExpectedTargetAlign);
977 
978  CharUnits
982 
983  /// Returns the offset from a derived class to a class. Returns null if the
984  /// offset is 0.
985  llvm::Constant *
989 
990  llvm::FoldingSet<BlockByrefHelpers> ByrefHelpersCache;
991 
992  /// Fetches the global unique block count.
993  int getUniqueBlockCount() { return ++Block.GlobalUniqueCount; }
994 
995  /// Fetches the type of a generic block descriptor.
996  llvm::Type *getBlockDescriptorType();
997 
998  /// The type of a generic block literal.
999  llvm::Type *getGenericBlockLiteralType();
1000 
1001  /// Gets the address of a block which requires no captures.
1002  llvm::Constant *GetAddrOfGlobalBlock(const BlockExpr *BE, StringRef Name);
1003 
1004  /// Returns the address of a block which requires no caputres, or null if
1005  /// we've yet to emit the block for BE.
1006  llvm::Constant *getAddrOfGlobalBlockIfEmitted(const BlockExpr *BE) {
1007  return EmittedGlobalBlocks.lookup(BE);
1008  }
1009 
1010  /// Notes that BE's global block is available via Addr. Asserts that BE
1011  /// isn't already emitted.
1012  void setAddrOfGlobalBlock(const BlockExpr *BE, llvm::Constant *Addr);
1013 
1014  /// Return a pointer to a constant CFString object for the given string.
1016 
1017  /// Return a pointer to a constant NSString object for the given string. Or a
1018  /// user defined String object as defined via
1019  /// -fconstant-string-class=class_name option.
1021 
1022  /// Return a constant array for the given string.
1023  llvm::Constant *GetConstantArrayFromStringLiteral(const StringLiteral *E);
1024 
1025  /// Return a pointer to a constant array for the given string literal.
1028  StringRef Name = ".str");
1029 
1030  /// Return a pointer to a constant array for the given ObjCEncodeExpr node.
1033 
1034  /// Returns a pointer to a character array containing the literal and a
1035  /// terminating '\0' character. The result has pointer to array type.
1036  ///
1037  /// \param GlobalName If provided, the name to use for the global (if one is
1038  /// created).
1041  const char *GlobalName = nullptr);
1042 
1043  /// Returns a pointer to a constant global variable for the given file-scope
1044  /// compound literal expression.
1046 
1047  /// If it's been emitted already, returns the GlobalVariable corresponding to
1048  /// a compound literal. Otherwise, returns null.
1049  llvm::GlobalVariable *
1051 
1052  /// Notes that CLE's GlobalVariable is GV. Asserts that CLE isn't already
1053  /// emitted.
1055  llvm::GlobalVariable *GV);
1056 
1057  /// Returns a pointer to a global variable representing a temporary
1058  /// with static or thread storage duration.
1060  const Expr *Inner);
1061 
1062  /// Retrieve the record type that describes the state of an
1063  /// Objective-C fast enumeration loop (for..in).
1065 
1066  // Produce code for this constructor/destructor. This method doesn't try
1067  // to apply any ABI rules about which other constructors/destructors
1068  // are needed or if they are alias to each other.
1069  llvm::Function *codegenCXXStructor(GlobalDecl GD);
1070 
1071  /// Return the address of the constructor/destructor of the given type.
1072  llvm::Constant *
1073  getAddrOfCXXStructor(GlobalDecl GD, const CGFunctionInfo *FnInfo = nullptr,
1074  llvm::FunctionType *FnType = nullptr,
1075  bool DontDefer = false,
1076  ForDefinition_t IsForDefinition = NotForDefinition) {
1077  return cast<llvm::Constant>(getAddrAndTypeOfCXXStructor(GD, FnInfo, FnType,
1078  DontDefer,
1079  IsForDefinition)
1080  .getCallee());
1081  }
1082 
1083  llvm::FunctionCallee getAddrAndTypeOfCXXStructor(
1084  GlobalDecl GD, const CGFunctionInfo *FnInfo = nullptr,
1085  llvm::FunctionType *FnType = nullptr, bool DontDefer = false,
1086  ForDefinition_t IsForDefinition = NotForDefinition);
1087 
1088  /// Given a builtin id for a function like "__builtin_fabsf", return a
1089  /// Function* for "fabsf".
1090  llvm::Constant *getBuiltinLibFunction(const FunctionDecl *FD,
1091  unsigned BuiltinID);
1092 
1093  llvm::Function *getIntrinsic(unsigned IID,
1094  ArrayRef<llvm::Type *> Tys = std::nullopt);
1095 
1096  /// Emit code for a single top level declaration.
1097  void EmitTopLevelDecl(Decl *D);
1098 
1099  /// Stored a deferred empty coverage mapping for an unused
1100  /// and thus uninstrumented top level declaration.
1102 
1103  /// Remove the deferred empty coverage mapping as this
1104  /// declaration is actually instrumented.
1105  void ClearUnusedCoverageMapping(const Decl *D);
1106 
1107  /// Emit all the deferred coverage mappings
1108  /// for the uninstrumented functions.
1110 
1111  /// Emit an alias for "main" if it has no arguments (needed for wasm).
1112  void EmitMainVoidAlias();
1113 
1114  /// Tell the consumer that this variable has been instantiated.
1116 
1117  /// If the declaration has internal linkage but is inside an
1118  /// extern "C" linkage specification, prepare to emit an alias for it
1119  /// to the expected name.
1120  template<typename SomeDecl>
1121  void MaybeHandleStaticInExternC(const SomeDecl *D, llvm::GlobalValue *GV);
1122 
1123  /// Add a global to a list to be added to the llvm.used metadata.
1124  void addUsedGlobal(llvm::GlobalValue *GV);
1125 
1126  /// Add a global to a list to be added to the llvm.compiler.used metadata.
1127  void addCompilerUsedGlobal(llvm::GlobalValue *GV);
1128 
1129  /// Add a global to a list to be added to the llvm.compiler.used metadata.
1130  void addUsedOrCompilerUsedGlobal(llvm::GlobalValue *GV);
1131 
1132  /// Add a destructor and object to add to the C++ global destructor function.
1133  void AddCXXDtorEntry(llvm::FunctionCallee DtorFn, llvm::Constant *Object) {
1134  CXXGlobalDtorsOrStermFinalizers.emplace_back(DtorFn.getFunctionType(),
1135  DtorFn.getCallee(), Object);
1136  }
1137 
1138  /// Add an sterm finalizer to the C++ global cleanup function.
1139  void AddCXXStermFinalizerEntry(llvm::FunctionCallee DtorFn) {
1140  CXXGlobalDtorsOrStermFinalizers.emplace_back(DtorFn.getFunctionType(),
1141  DtorFn.getCallee(), nullptr);
1142  }
1143 
1144  /// Add an sterm finalizer to its own llvm.global_dtors entry.
1145  void AddCXXStermFinalizerToGlobalDtor(llvm::Function *StermFinalizer,
1146  int Priority) {
1147  AddGlobalDtor(StermFinalizer, Priority);
1148  }
1149 
1150  void AddCXXPrioritizedStermFinalizerEntry(llvm::Function *StermFinalizer,
1151  int Priority) {
1153  PrioritizedCXXStermFinalizers.size());
1154  PrioritizedCXXStermFinalizers.push_back(
1155  std::make_pair(Key, StermFinalizer));
1156  }
1157 
1158  /// Create or return a runtime function declaration with the specified type
1159  /// and name. If \p AssumeConvergent is true, the call will have the
1160  /// convergent attribute added.
1161  llvm::FunctionCallee
1162  CreateRuntimeFunction(llvm::FunctionType *Ty, StringRef Name,
1163  llvm::AttributeList ExtraAttrs = llvm::AttributeList(),
1164  bool Local = false, bool AssumeConvergent = false);
1165 
1166  /// Create a new runtime global variable with the specified type and name.
1167  llvm::Constant *CreateRuntimeVariable(llvm::Type *Ty,
1168  StringRef Name);
1169 
1170  ///@name Custom Blocks Runtime Interfaces
1171  ///@{
1172 
1173  llvm::Constant *getNSConcreteGlobalBlock();
1174  llvm::Constant *getNSConcreteStackBlock();
1175  llvm::FunctionCallee getBlockObjectAssign();
1176  llvm::FunctionCallee getBlockObjectDispose();
1177 
1178  ///@}
1179 
1180  llvm::Function *getLLVMLifetimeStartFn();
1181  llvm::Function *getLLVMLifetimeEndFn();
1182 
1183  // Make sure that this type is translated.
1184  void UpdateCompletedType(const TagDecl *TD);
1185 
1186  llvm::Constant *getMemberPointerConstant(const UnaryOperator *e);
1187 
1188  /// Emit type info if type of an expression is a variably modified
1189  /// type. Also emit proper debug info for cast types.
1191  CodeGenFunction *CGF = nullptr);
1192 
1193  /// Return the result of value-initializing the given type, i.e. a null
1194  /// expression of the given type. This is usually, but not always, an LLVM
1195  /// null constant.
1196  llvm::Constant *EmitNullConstant(QualType T);
1197 
1198  /// Return a null constant appropriate for zero-initializing a base class with
1199  /// the given type. This is usually, but not always, an LLVM null constant.
1200  llvm::Constant *EmitNullConstantForBase(const CXXRecordDecl *Record);
1201 
1202  /// Emit a general error that something can't be done.
1203  void Error(SourceLocation loc, StringRef error);
1204 
1205  /// Print out an error that codegen doesn't support the specified stmt yet.
1206  void ErrorUnsupported(const Stmt *S, const char *Type);
1207 
1208  /// Print out an error that codegen doesn't support the specified decl yet.
1209  void ErrorUnsupported(const Decl *D, const char *Type);
1210 
1211  /// Set the attributes on the LLVM function for the given decl and function
1212  /// info. This applies attributes necessary for handling the ABI as well as
1213  /// user specified attributes like section.
1214  void SetInternalFunctionAttributes(GlobalDecl GD, llvm::Function *F,
1215  const CGFunctionInfo &FI);
1216 
1217  /// Set the LLVM function attributes (sext, zext, etc).
1219  llvm::Function *F, bool IsThunk);
1220 
1221  /// Set the LLVM function attributes which only apply to a function
1222  /// definition.
1223  void SetLLVMFunctionAttributesForDefinition(const Decl *D, llvm::Function *F);
1224 
1225  /// Set the LLVM function attributes that represent floating point
1226  /// environment.
1227  void setLLVMFunctionFEnvAttributes(const FunctionDecl *D, llvm::Function *F);
1228 
1229  /// Return true iff the given type uses 'sret' when used as a return type.
1230  bool ReturnTypeUsesSRet(const CGFunctionInfo &FI);
1231 
1232  /// Return true iff the given type uses an argument slot when 'sret' is used
1233  /// as a return type.
1235 
1236  /// Return true iff the given type uses 'fpret' when used as a return type.
1237  bool ReturnTypeUsesFPRet(QualType ResultType);
1238 
1239  /// Return true iff the given type uses 'fp2ret' when used as a return type.
1240  bool ReturnTypeUsesFP2Ret(QualType ResultType);
1241 
1242  /// Get the LLVM attributes and calling convention to use for a particular
1243  /// function type.
1244  ///
1245  /// \param Name - The function name.
1246  /// \param Info - The function type information.
1247  /// \param CalleeInfo - The callee information these attributes are being
1248  /// constructed for. If valid, the attributes applied to this decl may
1249  /// contribute to the function attributes and calling convention.
1250  /// \param Attrs [out] - On return, the attribute list to use.
1251  /// \param CallingConv [out] - On return, the LLVM calling convention to use.
1252  void ConstructAttributeList(StringRef Name, const CGFunctionInfo &Info,
1253  CGCalleeInfo CalleeInfo,
1254  llvm::AttributeList &Attrs, unsigned &CallingConv,
1255  bool AttrOnCallSite, bool IsThunk);
1256 
1257  /// Adds attributes to F according to our CodeGenOptions and LangOptions, as
1258  /// though we had emitted it ourselves. We remove any attributes on F that
1259  /// conflict with the attributes we add here.
1260  ///
1261  /// This is useful for adding attrs to bitcode modules that you want to link
1262  /// with but don't control, such as CUDA's libdevice. When linking with such
1263  /// a bitcode library, you might want to set e.g. its functions'
1264  /// "unsafe-fp-math" attribute to match the attr of the functions you're
1265  /// codegen'ing. Otherwise, LLVM will interpret the bitcode module's lack of
1266  /// unsafe-fp-math attrs as tantamount to unsafe-fp-math=false, and then LLVM
1267  /// will propagate unsafe-fp-math=false up to every transitive caller of a
1268  /// function in the bitcode library!
1269  ///
1270  /// With the exception of fast-math attrs, this will only make the attributes
1271  /// on the function more conservative. But it's unsafe to call this on a
1272  /// function which relies on particular fast-math attributes for correctness.
1273  /// It's up to you to ensure that this is safe.
1274  void addDefaultFunctionDefinitionAttributes(llvm::Function &F);
1275 
1276  /// Like the overload taking a `Function &`, but intended specifically
1277  /// for frontends that want to build on Clang's target-configuration logic.
1278  void addDefaultFunctionDefinitionAttributes(llvm::AttrBuilder &attrs);
1279 
1280  StringRef getMangledName(GlobalDecl GD);
1281  StringRef getBlockMangledName(GlobalDecl GD, const BlockDecl *BD);
1282  const GlobalDecl getMangledNameDecl(StringRef);
1283 
1284  void EmitTentativeDefinition(const VarDecl *D);
1285 
1286  void EmitExternalDeclaration(const VarDecl *D);
1287 
1288  void EmitVTable(CXXRecordDecl *Class);
1289 
1290  void RefreshTypeCacheForClass(const CXXRecordDecl *Class);
1291 
1292  /// Appends Opts to the "llvm.linker.options" metadata value.
1293  void AppendLinkerOptions(StringRef Opts);
1294 
1295  /// Appends a detect mismatch command to the linker options.
1296  void AddDetectMismatch(StringRef Name, StringRef Value);
1297 
1298  /// Appends a dependent lib to the appropriate metadata value.
1299  void AddDependentLib(StringRef Lib);
1300 
1301 
1302  llvm::GlobalVariable::LinkageTypes getFunctionLinkage(GlobalDecl GD);
1303 
1304  void setFunctionLinkage(GlobalDecl GD, llvm::Function *F) {
1305  F->setLinkage(getFunctionLinkage(GD));
1306  }
1307 
1308  /// Return the appropriate linkage for the vtable, VTT, and type information
1309  /// of the given class.
1310  llvm::GlobalVariable::LinkageTypes getVTableLinkage(const CXXRecordDecl *RD);
1311 
1312  /// Return the store size, in character units, of the given LLVM type.
1313  CharUnits GetTargetTypeStoreSize(llvm::Type *Ty) const;
1314 
1315  /// Returns LLVM linkage for a declarator.
1316  llvm::GlobalValue::LinkageTypes
1318  bool IsConstantVariable);
1319 
1320  /// Returns LLVM linkage for a declarator.
1321  llvm::GlobalValue::LinkageTypes
1322  getLLVMLinkageVarDefinition(const VarDecl *VD, bool IsConstant);
1323 
1324  /// Emit all the global annotations.
1325  void EmitGlobalAnnotations();
1326 
1327  /// Emit an annotation string.
1328  llvm::Constant *EmitAnnotationString(StringRef Str);
1329 
1330  /// Emit the annotation's translation unit.
1331  llvm::Constant *EmitAnnotationUnit(SourceLocation Loc);
1332 
1333  /// Emit the annotation line number.
1334  llvm::Constant *EmitAnnotationLineNo(SourceLocation L);
1335 
1336  /// Emit additional args of the annotation.
1337  llvm::Constant *EmitAnnotationArgs(const AnnotateAttr *Attr);
1338 
1339  /// Generate the llvm::ConstantStruct which contains the annotation
1340  /// information for a given GlobalValue. The annotation struct is
1341  /// {i8 *, i8 *, i8 *, i32}. The first field is a constant expression, the
1342  /// GlobalValue being annotated. The second field is the constant string
1343  /// created from the AnnotateAttr's annotation. The third field is a constant
1344  /// string containing the name of the translation unit. The fourth field is
1345  /// the line number in the file of the annotated value declaration.
1346  llvm::Constant *EmitAnnotateAttr(llvm::GlobalValue *GV,
1347  const AnnotateAttr *AA,
1348  SourceLocation L);
1349 
1350  /// Add global annotations that are set on D, for the global GV. Those
1351  /// annotations are emitted during finalization of the LLVM code.
1352  void AddGlobalAnnotations(const ValueDecl *D, llvm::GlobalValue *GV);
1353 
1354  bool isInNoSanitizeList(SanitizerMask Kind, llvm::Function *Fn,
1355  SourceLocation Loc) const;
1356 
1357  bool isInNoSanitizeList(SanitizerMask Kind, llvm::GlobalVariable *GV,
1358  SourceLocation Loc, QualType Ty,
1359  StringRef Category = StringRef()) const;
1360 
1361  /// Imbue XRay attributes to a function, applying the always/never attribute
1362  /// lists in the process. Returns true if we did imbue attributes this way,
1363  /// false otherwise.
1364  bool imbueXRayAttrs(llvm::Function *Fn, SourceLocation Loc,
1365  StringRef Category = StringRef()) const;
1366 
1367  /// \returns true if \p Fn at \p Loc should be excluded from profile
1368  /// instrumentation by the SCL passed by \p -fprofile-list.
1370  isFunctionBlockedByProfileList(llvm::Function *Fn, SourceLocation Loc) const;
1371 
1372  /// \returns true if \p Fn at \p Loc should be excluded from profile
1373  /// instrumentation.
1375  isFunctionBlockedFromProfileInstr(llvm::Function *Fn,
1376  SourceLocation Loc) const;
1377 
1379  return SanitizerMD.get();
1380  }
1381 
1383  DeferredVTables.push_back(RD);
1384  }
1385 
1386  /// Emit code for a single global function or var decl. Forward declarations
1387  /// are emitted lazily.
1388  void EmitGlobal(GlobalDecl D);
1389 
1391 
1392  llvm::GlobalValue *GetGlobalValue(StringRef Ref);
1393 
1394  /// Set attributes which are common to any form of a global definition (alias,
1395  /// Objective-C method, function, global variable).
1396  ///
1397  /// NOTE: This should only be called for definitions.
1398  void SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV);
1399 
1400  void addReplacement(StringRef Name, llvm::Constant *C);
1401 
1402  void addGlobalValReplacement(llvm::GlobalValue *GV, llvm::Constant *C);
1403 
1404  /// Emit a code for threadprivate directive.
1405  /// \param D Threadprivate declaration.
1407 
1408  /// Emit a code for declare reduction construct.
1410  CodeGenFunction *CGF = nullptr);
1411 
1412  /// Emit a code for declare mapper construct.
1414  CodeGenFunction *CGF = nullptr);
1415 
1416  /// Emit a code for requires directive.
1417  /// \param D Requires declaration
1418  void EmitOMPRequiresDecl(const OMPRequiresDecl *D);
1419 
1420  /// Emit a code for the allocate directive.
1421  /// \param D The allocate declaration
1422  void EmitOMPAllocateDecl(const OMPAllocateDecl *D);
1423 
1424  /// Return the alignment specified in an allocate directive, if present.
1425  std::optional<CharUnits> getOMPAllocateAlignment(const VarDecl *VD);
1426 
1427  /// Returns whether the given record has hidden LTO visibility and therefore
1428  /// may participate in (single-module) CFI and whole-program vtable
1429  /// optimization.
1430  bool HasHiddenLTOVisibility(const CXXRecordDecl *RD);
1431 
1432  /// Returns whether the given record has public LTO visibility (regardless of
1433  /// -lto-whole-program-visibility) and therefore may not participate in
1434  /// (single-module) CFI and whole-program vtable optimization.
1436 
1437  /// Returns the vcall visibility of the given type. This is the scope in which
1438  /// a virtual function call could be made which ends up being dispatched to a
1439  /// member function of this class. This scope can be wider than the visibility
1440  /// of the class itself when the class has a more-visible dynamic base class.
1441  /// The client should pass in an empty Visited set, which is used to prevent
1442  /// redundant recursive processing.
1443  llvm::GlobalObject::VCallVisibility
1446 
1447  /// Emit type metadata for the given vtable using the given layout.
1448  void EmitVTableTypeMetadata(const CXXRecordDecl *RD,
1449  llvm::GlobalVariable *VTable,
1450  const VTableLayout &VTLayout);
1451 
1452  llvm::Type *getVTableComponentType() const;
1453 
1454  /// Generate a cross-DSO type identifier for MD.
1455  llvm::ConstantInt *CreateCrossDsoCfiTypeId(llvm::Metadata *MD);
1456 
1457  /// Generate a KCFI type identifier for T.
1458  llvm::ConstantInt *CreateKCFITypeId(QualType T);
1459 
1460  /// Create a metadata identifier for the given type. This may either be an
1461  /// MDString (for external identifiers) or a distinct unnamed MDNode (for
1462  /// internal identifiers).
1463  llvm::Metadata *CreateMetadataIdentifierForType(QualType T);
1464 
1465  /// Create a metadata identifier that is intended to be used to check virtual
1466  /// calls via a member function pointer.
1468 
1469  /// Create a metadata identifier for the generalization of the given type.
1470  /// This may either be an MDString (for external identifiers) or a distinct
1471  /// unnamed MDNode (for internal identifiers).
1472  llvm::Metadata *CreateMetadataIdentifierGeneralized(QualType T);
1473 
1474  /// Create and attach type metadata to the given function.
1476  llvm::Function *F);
1477 
1478  /// Set type metadata to the given function.
1479  void setKCFIType(const FunctionDecl *FD, llvm::Function *F);
1480 
1481  /// Emit KCFI type identifier constants and remove unused identifiers.
1482  void finalizeKCFITypes();
1483 
1484  /// Whether this function's return type has no side effects, and thus may
1485  /// be trivially discarded if it is unused.
1486  bool MayDropFunctionReturn(const ASTContext &Context,
1487  QualType ReturnType) const;
1488 
1489  /// Returns whether this module needs the "all-vtables" type identifier.
1490  bool NeedAllVtablesTypeId() const;
1491 
1492  /// Create and attach type metadata for the given vtable.
1493  void AddVTableTypeMetadata(llvm::GlobalVariable *VTable, CharUnits Offset,
1494  const CXXRecordDecl *RD);
1495 
1496  /// Return a vector of most-base classes for RD. This is used to implement
1497  /// control flow integrity checks for member function pointers.
1498  ///
1499  /// A most-base class of a class C is defined as a recursive base class of C,
1500  /// including C itself, that does not have any bases.
1501  std::vector<const CXXRecordDecl *>
1502  getMostBaseClasses(const CXXRecordDecl *RD);
1503 
1504  llvm::GlobalVariable *
1505  GetOrCreateRTTIProxyGlobalVariable(llvm::Constant *Addr);
1506 
1507  /// Get the declaration of std::terminate for the platform.
1508  llvm::FunctionCallee getTerminateFn();
1509 
1510  llvm::SanitizerStatReport &getSanStats();
1511 
1512  llvm::Value *
1514 
1515  /// OpenCL v1.2 s5.6.4.6 allows the compiler to store kernel argument
1516  /// information in the program executable. The argument information stored
1517  /// includes the argument name, its type, the address and access qualifiers
1518  /// used. This helper can be used to generate metadata for source code kernel
1519  /// function as well as generated implicitly kernels. If a kernel is generated
1520  /// implicitly null value has to be passed to the last two parameters,
1521  /// otherwise all parameters must have valid non-null values.
1522  /// \param FN is a pointer to IR function being generated.
1523  /// \param FD is a pointer to function declaration if any.
1524  /// \param CGF is a pointer to CodeGenFunction that generates this function.
1525  void GenKernelArgMetadata(llvm::Function *FN,
1526  const FunctionDecl *FD = nullptr,
1527  CodeGenFunction *CGF = nullptr);
1528 
1529  /// Get target specific null pointer.
1530  /// \param T is the LLVM type of the null pointer.
1531  /// \param QT is the clang QualType of the null pointer.
1532  llvm::Constant *getNullPointer(llvm::PointerType *T, QualType QT);
1533 
1535  LValueBaseInfo *BaseInfo = nullptr,
1536  TBAAAccessInfo *TBAAInfo = nullptr,
1537  bool forPointeeType = false);
1539  LValueBaseInfo *BaseInfo = nullptr,
1540  TBAAAccessInfo *TBAAInfo = nullptr);
1541  bool stopAutoInit();
1542 
1543  /// Print the postfix for externalized static variable or kernels for single
1544  /// source offloading languages CUDA and HIP. The unique postfix is created
1545  /// using either the CUID argument, or the file's UniqueID and active macros.
1546  /// The fallback method without a CUID requires that the offloading toolchain
1547  /// does not define separate macros via the -cc1 options.
1548  void printPostfixForExternalizedDecl(llvm::raw_ostream &OS,
1549  const Decl *D) const;
1550 
1551  /// Move some lazily-emitted states to the NewBuilder. This is especially
1552  /// essential for the incremental parsing environment like Clang Interpreter,
1553  /// because we'll lose all important information after each repl.
1554  void moveLazyEmissionStates(CodeGenModule *NewBuilder);
1555 
1556 private:
1557  llvm::Constant *GetOrCreateLLVMFunction(
1558  StringRef MangledName, llvm::Type *Ty, GlobalDecl D, bool ForVTable,
1559  bool DontDefer = false, bool IsThunk = false,
1560  llvm::AttributeList ExtraAttrs = llvm::AttributeList(),
1561  ForDefinition_t IsForDefinition = NotForDefinition);
1562 
1563  // References to multiversion functions are resolved through an implicitly
1564  // defined resolver function. This function is responsible for creating
1565  // the resolver symbol for the provided declaration. The value returned
1566  // will be for an ifunc (llvm::GlobalIFunc) if the current target supports
1567  // that feature and for a regular function (llvm::GlobalValue) otherwise.
1568  llvm::Constant *GetOrCreateMultiVersionResolver(GlobalDecl GD);
1569 
1570  // In scenarios where a function is not known to be a multiversion function
1571  // until a later declaration, it is sometimes necessary to change the
1572  // previously created mangled name to align with requirements of whatever
1573  // multiversion function kind the function is now known to be. This function
1574  // is responsible for performing such mangled name updates.
1575  void UpdateMultiVersionNames(GlobalDecl GD, const FunctionDecl *FD,
1576  StringRef &CurName);
1577 
1578  llvm::Constant *
1579  GetOrCreateLLVMGlobal(StringRef MangledName, llvm::Type *Ty, LangAS AddrSpace,
1580  const VarDecl *D,
1581  ForDefinition_t IsForDefinition = NotForDefinition);
1582 
1583  bool GetCPUAndFeaturesAttributes(GlobalDecl GD,
1584  llvm::AttrBuilder &AttrBuilder);
1585  void setNonAliasAttributes(GlobalDecl GD, llvm::GlobalObject *GO);
1586 
1587  /// Set function attributes for a function declaration.
1588  void SetFunctionAttributes(GlobalDecl GD, llvm::Function *F,
1589  bool IsIncompleteFunction, bool IsThunk);
1590 
1591  void EmitGlobalDefinition(GlobalDecl D, llvm::GlobalValue *GV = nullptr);
1592 
1593  void EmitGlobalFunctionDefinition(GlobalDecl GD, llvm::GlobalValue *GV);
1594  void EmitMultiVersionFunctionDefinition(GlobalDecl GD, llvm::GlobalValue *GV);
1595 
1596  void EmitGlobalVarDefinition(const VarDecl *D, bool IsTentative = false);
1597  void EmitExternalVarDeclaration(const VarDecl *D);
1598  void EmitAliasDefinition(GlobalDecl GD);
1599  void emitIFuncDefinition(GlobalDecl GD);
1600  void emitCPUDispatchDefinition(GlobalDecl GD);
1601  void EmitObjCPropertyImplementations(const ObjCImplementationDecl *D);
1602  void EmitObjCIvarInitializations(ObjCImplementationDecl *D);
1603 
1604  // C++ related functions.
1605 
1606  void EmitDeclContext(const DeclContext *DC);
1607  void EmitLinkageSpec(const LinkageSpecDecl *D);
1608  void EmitTopLevelStmt(const TopLevelStmtDecl *D);
1609 
1610  /// Emit the function that initializes C++ thread_local variables.
1611  void EmitCXXThreadLocalInitFunc();
1612 
1613  /// Emit the function that initializes global variables for a C++ Module.
1614  void EmitCXXModuleInitFunc(clang::Module *Primary);
1615 
1616  /// Emit the function that initializes C++ globals.
1617  void EmitCXXGlobalInitFunc();
1618 
1619  /// Emit the function that performs cleanup associated with C++ globals.
1620  void EmitCXXGlobalCleanUpFunc();
1621 
1622  /// Emit the function that initializes the specified global (if PerformInit is
1623  /// true) and registers its destructor.
1624  void EmitCXXGlobalVarDeclInitFunc(const VarDecl *D,
1625  llvm::GlobalVariable *Addr,
1626  bool PerformInit);
1627 
1628  void EmitPointerToInitFunc(const VarDecl *VD, llvm::GlobalVariable *Addr,
1629  llvm::Function *InitFunc, InitSegAttr *ISA);
1630 
1631  // FIXME: Hardcoding priority here is gross.
1632  void AddGlobalCtor(llvm::Function *Ctor, int Priority = 65535,
1633  unsigned LexOrder = ~0U,
1634  llvm::Constant *AssociatedData = nullptr);
1635  void AddGlobalDtor(llvm::Function *Dtor, int Priority = 65535,
1636  bool IsDtorAttrFunc = false);
1637 
1638  /// EmitCtorList - Generates a global array of functions and priorities using
1639  /// the given list and name. This array will have appending linkage and is
1640  /// suitable for use as a LLVM constructor or destructor array. Clears Fns.
1641  void EmitCtorList(CtorList &Fns, const char *GlobalName);
1642 
1643  /// Emit any needed decls for which code generation was deferred.
1644  void EmitDeferred();
1645 
1646  /// Try to emit external vtables as available_externally if they have emitted
1647  /// all inlined virtual functions. It runs after EmitDeferred() and therefore
1648  /// is not allowed to create new references to things that need to be emitted
1649  /// lazily.
1650  void EmitVTablesOpportunistically();
1651 
1652  /// Call replaceAllUsesWith on all pairs in Replacements.
1653  void applyReplacements();
1654 
1655  /// Call replaceAllUsesWith on all pairs in GlobalValReplacements.
1656  void applyGlobalValReplacements();
1657 
1658  void checkAliases();
1659 
1660  std::map<int, llvm::TinyPtrVector<llvm::Function *>> DtorsUsingAtExit;
1661 
1662  /// Register functions annotated with __attribute__((destructor)) using
1663  /// __cxa_atexit, if it is available, or atexit otherwise.
1664  void registerGlobalDtorsWithAtExit();
1665 
1666  // When using sinit and sterm functions, unregister
1667  // __attribute__((destructor)) annotated functions which were previously
1668  // registered by the atexit subroutine using unatexit.
1669  void unregisterGlobalDtorsWithUnAtExit();
1670 
1671  /// Emit deferred multiversion function resolvers and associated variants.
1672  void emitMultiVersionFunctions();
1673 
1674  /// Emit any vtables which we deferred and still have a use for.
1675  void EmitDeferredVTables();
1676 
1677  /// Emit a dummy function that reference a CoreFoundation symbol when
1678  /// @available is used on Darwin.
1679  void emitAtAvailableLinkGuard();
1680 
1681  /// Emit the llvm.used and llvm.compiler.used metadata.
1682  void emitLLVMUsed();
1683 
1684  /// For C++20 Itanium ABI, emit the initializers for the module.
1685  void EmitModuleInitializers(clang::Module *Primary);
1686 
1687  /// Emit the link options introduced by imported modules.
1688  void EmitModuleLinkOptions();
1689 
1690  /// Helper function for EmitStaticExternCAliases() to redirect ifuncs that
1691  /// have a resolver name that matches 'Elem' to instead resolve to the name of
1692  /// 'CppFunc'. This redirection is necessary in cases where 'Elem' has a name
1693  /// that will be emitted as an alias of the name bound to 'CppFunc'; ifuncs
1694  /// may not reference aliases. Redirection is only performed if 'Elem' is only
1695  /// used by ifuncs in which case, 'Elem' is destroyed. 'true' is returned if
1696  /// redirection is successful, and 'false' is returned otherwise.
1697  bool CheckAndReplaceExternCIFuncs(llvm::GlobalValue *Elem,
1698  llvm::GlobalValue *CppFunc);
1699 
1700  /// Emit aliases for internal-linkage declarations inside "C" language
1701  /// linkage specifications, giving them the "expected" name where possible.
1702  void EmitStaticExternCAliases();
1703 
1704  void EmitDeclMetadata();
1705 
1706  /// Emit the Clang version as llvm.ident metadata.
1707  void EmitVersionIdentMetadata();
1708 
1709  /// Emit the Clang commandline as llvm.commandline metadata.
1710  void EmitCommandLineMetadata();
1711 
1712  /// Emit the module flag metadata used to pass options controlling the
1713  /// the backend to LLVM.
1714  void EmitBackendOptionsMetadata(const CodeGenOptions CodeGenOpts);
1715 
1716  /// Emits OpenCL specific Metadata e.g. OpenCL version.
1717  void EmitOpenCLMetadata();
1718 
1719  /// Emit the llvm.gcov metadata used to tell LLVM where to emit the .gcno and
1720  /// .gcda files in a way that persists in .bc files.
1721  void EmitCoverageFile();
1722 
1723  /// Determine whether the definition must be emitted; if this returns \c
1724  /// false, the definition can be emitted lazily if it's used.
1725  bool MustBeEmitted(const ValueDecl *D);
1726 
1727  /// Determine whether the definition can be emitted eagerly, or should be
1728  /// delayed until the end of the translation unit. This is relevant for
1729  /// definitions whose linkage can change, e.g. implicit function instantions
1730  /// which may later be explicitly instantiated.
1731  bool MayBeEmittedEagerly(const ValueDecl *D);
1732 
1733  /// Check whether we can use a "simpler", more core exceptions personality
1734  /// function.
1735  void SimplifyPersonality();
1736 
1737  /// Helper function for ConstructAttributeList and
1738  /// addDefaultFunctionDefinitionAttributes. Builds a set of function
1739  /// attributes to add to a function with the given properties.
1740  void getDefaultFunctionAttributes(StringRef Name, bool HasOptnone,
1741  bool AttrOnCallSite,
1742  llvm::AttrBuilder &FuncAttrs);
1743 
1744  llvm::Metadata *CreateMetadataIdentifierImpl(QualType T, MetadataTypeMap &Map,
1745  StringRef Suffix);
1746 };
1747 
1748 } // end namespace CodeGen
1749 } // end namespace clang
1750 
1751 #endif // LLVM_CLANG_LIB_CODEGEN_CODEGENMODULE_H
clang::CodeGen::CodeGenModule::isFunctionBlockedByProfileList
ProfileList::ExclusionType isFunctionBlockedByProfileList(llvm::Function *Fn, SourceLocation Loc) const
Definition: CodeGenModule.cpp:3026
clang::CodeGen::CodeGenModule::isTypeConstant
bool isTypeConstant(QualType QTy, bool ExcludeCtorDtor)
isTypeConstant - Determine whether an object of this type can be emitted as a constant.
Definition: CodeGenModule.cpp:4320
clang::InternalLinkage
@ InternalLinkage
Internal linkage, which indicates that the entity can be referred to from within the translation unit...
Definition: Linkage.h:31
clang::CodeGen::ObjCEntrypoints::objc_autoreleasePoolPop
llvm::FunctionCallee objc_autoreleasePoolPop
void objc_autoreleasePoolPop(void*);
Definition: CodeGenModule.h:131
CodeGenTypeCache.h
clang::CodeGen::BlockByrefHelpers::~BlockByrefHelpers
virtual ~BlockByrefHelpers()
Definition: CGBlocks.cpp:48
clang::ASTContext::getTypeSizeInChars
CharUnits getTypeSizeInChars(QualType T) const
Return the size of the specified (complete) type T, in characters.
Definition: ASTContext.cpp:2563
clang::CodeGen::CodeGenModule::createOpenCLIntToSamplerConversion
llvm::Value * createOpenCLIntToSamplerConversion(const Expr *E, CodeGenFunction &CGF)
Definition: CodeGenModule.cpp:7045
clang::OMPAllocateDecl
This represents '#pragma omp allocate ...' directive.
Definition: DeclOpenMP.h:473
clang::CodeGen::CodeGenModule::addUsedOrCompilerUsedGlobal
void addUsedOrCompilerUsedGlobal(llvm::GlobalValue *GV)
Add a global to a list to be added to the llvm.compiler.used metadata.
Definition: CodeGenModule.cpp:2527
clang::LangOptions::isExplicitDefaultVisibilityExportMapping
bool isExplicitDefaultVisibilityExportMapping() const
Definition: LangOptions.h:629
clang::CodeGen::CodeGenModule::MaybeHandleStaticInExternC
void MaybeHandleStaticInExternC(const SomeDecl *D, llvm::GlobalValue *GV)
If the declaration has internal linkage but is inside an extern "C" linkage specification,...
Definition: CodeGenModule.cpp:4755
clang::CodeGen::ObjCEntrypoints::objc_allocWithZone
llvm::FunctionCallee objc_allocWithZone
void objc_allocWithZone(id);
Definition: CodeGenModule.h:125
clang::CodeGen::CodeGenModule::getStaticLocalDeclGuardAddress
llvm::GlobalVariable * getStaticLocalDeclGuardAddress(const VarDecl *D)
Definition: CodeGenModule.h:683
clang::CodeGen::LValueBaseInfo
Definition: CGValue.h:154
clang::HiddenVisibility
@ HiddenVisibility
Objects with "hidden" visibility are not seen by the dynamic linker.
Definition: Visibility.h:36
clang::CodeGen::CodeGenModule::GetAddrOfGlobalVar
llvm::Constant * GetAddrOfGlobalVar(const VarDecl *D, llvm::Type *Ty=nullptr, ForDefinition_t IsForDefinition=NotForDefinition)
Return the llvm::Constant for the address of the given global variable.
Definition: CodeGenModule.cpp:4617
llvm
YAML serialization mapping.
Definition: Dominators.h:30
clang::CodeGen::CodeGenModule::Structor::Priority
int Priority
Definition: CodeGenModule.h:293
clang::CodeGen::ConstantAddress
A specialization of Address that requires the address to be an LLVM Constant.
Definition: Address.h:140
clang::CodeGen::CodeGenModule::addDeferredVTable
void addDeferredVTable(const CXXRecordDecl *RD)
Definition: CodeGenModule.h:1382
clang::CodeGen::CGCUDARuntime
Definition: CGCUDARuntime.h:41
clang::CodeGen::CodeGenModule::lookupRepresentativeDecl
bool lookupRepresentativeDecl(StringRef MangledName, GlobalDecl &Result) const
Definition: CodeGenModule.cpp:6798
clang::CodeGen::ObjCEntrypoints::objc_retainAutoreleasedReturnValue
llvm::Function * objc_retainAutoreleasedReturnValue
id objc_retainAutoreleasedReturnValue(id);
Definition: CodeGenModule.h:182
clang::CodeGen::CodeGenModule::EmitNullConstant
llvm::Constant * EmitNullConstant(QualType T)
Return the result of value-initializing the given type, i.e.
Definition: CGExprConstant.cpp:2343
clang::CodeGen::CodeGenModule::CreateRuntimeFunction
llvm::FunctionCallee CreateRuntimeFunction(llvm::FunctionType *Ty, StringRef Name, llvm::AttributeList ExtraAttrs=llvm::AttributeList(), bool Local=false, bool AssumeConvergent=false)
Create or return a runtime function declaration with the specified type and name.
Definition: CodeGenModule.cpp:4277
clang::CodeGen::OrderGlobalInitsOrStermFinalizers
Definition: CodeGenModule.h:102
clang::CodeGen::CodeGenModule::setAddrOfGlobalBlock
void setAddrOfGlobalBlock(const BlockExpr *BE, llvm::Constant *Addr)
Notes that BE's global block is available via Addr.
Definition: CGBlocks.cpp:1280
clang::CodeGen::CGHLSLRuntime
Definition: CGHLSLRuntime.h:49
clang::CodeGen::CGOpenMPRuntime
Definition: CGOpenMPRuntime.h:229
clang::CodeGen::CodeGenModule::ClearUnusedCoverageMapping
void ClearUnusedCoverageMapping(const Decl *D)
Remove the deferred empty coverage mapping as this declaration is actually instrumented.
Definition: CodeGenModule.cpp:6613
clang::CodeGen::BlockByrefHelpers::BlockByrefHelpers
BlockByrefHelpers(CharUnits alignment)
Definition: CodeGenModule.h:260
clang::CodeGen::CodeGenModule::getItaniumVTableContext
ItaniumVTableContext & getItaniumVTableContext()
Definition: CodeGenModule.h:760
clang::LinkageSpecDecl
Represents a linkage specification.
Definition: DeclCXX.h:2844
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:23
clang::CodeGen::CodeGenModule::CreateMetadataIdentifierGeneralized
llvm::Metadata * CreateMetadataIdentifierGeneralized(QualType T)
Create a metadata identifier for the generalization of the given type.
Definition: CodeGenModule.cpp:7000
clang::PreprocessorOptions
PreprocessorOptions - This class is used for passing the various options used in preprocessor initial...
Definition: PreprocessorOptions.h:66
clang::DeclContext
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1389
clang::CodeGen::InstrProfStats::hasDiagnostics
bool hasDiagnostics()
Whether or not the stats we've gathered indicate any potential problems.
Definition: CodeGenModule.h:242
clang::CodeGen::ForDefinition_t
ForDefinition_t
Definition: CodeGenModule.h:97
clang::ObjCImplementationDecl
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2584
clang::CodeGen::CodeGenModule::addUsedGlobal
void addUsedGlobal(llvm::GlobalValue *GV)
Add a global to a list to be added to the llvm.used metadata.
Definition: CodeGenModule.cpp:2515
clang::CodeGen::CodeGenModule::getOpenCLRuntime
CGOpenCLRuntime & getOpenCLRuntime()
Return a reference to the configured OpenCL runtime.
Definition: CodeGenModule.h:630
clang::CodeGen::InstrProfStats
This class records statistics on instrumentation based profiling.
Definition: CodeGenModule.h:215
clang::CodeGen::ObjCEntrypoints::clang_arc_noop_use
llvm::Function * clang_arc_noop_use
void clang.arc.noop.use(...);
Definition: CodeGenModule.h:211
clang::CodeGen::CodeGenModule::codegenCXXStructor
llvm::Function * codegenCXXStructor(GlobalDecl GD)
Definition: CGCXX.cpp:207
clang::CodeGen::CodeGenModule::getDynamicOffsetAlignment
CharUnits getDynamicOffsetAlignment(CharUnits ActualAlign, const CXXRecordDecl *Class, CharUnits ExpectedTargetAlign)
Given a class pointer with an actual known alignment, and the expected alignment of an object at a dy...
Definition: CGClass.cpp:90
clang::CodeGen::CodeGenModule::GetAddrOfFunction
llvm::Constant * GetAddrOfFunction(GlobalDecl GD, llvm::Type *Ty=nullptr, bool ForVTable=false, bool DontDefer=false, ForDefinition_t IsForDefinition=NotForDefinition)
Return the address of the given function.
Definition: CodeGenModule.cpp:4188
clang::CodeGen::CodeGenModule::getTBAAAccessTagInfo
llvm::MDNode * getTBAAAccessTagInfo(TBAAAccessInfo Info)
getTBAAAccessTagInfo - Get TBAA tag for a given memory access.
Definition: CodeGenModule.cpp:1041
clang::CodeGen::ObjCEntrypoints::objc_retainAutoreleaseReturnValue
llvm::Function * objc_retainAutoreleaseReturnValue
id objc_retainAutoreleaseReturnValue(id);
Definition: CodeGenModule.h:179
clang::CodeGen::CodeGenModule::setAtomicSetterHelperFnMap
void setAtomicSetterHelperFnMap(QualType Ty, llvm::Constant *Fn)
Definition: CodeGenModule.h:700
llvm::SmallVector
Definition: LLVM.h:38
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:86
clang::CodeGen::TargetCodeGenInfo
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues,...
Definition: TargetInfo.h:46
clang::CodeGen::CodeGenModule::mergeTBAAInfoForCast
TBAAAccessInfo mergeTBAAInfoForCast(TBAAAccessInfo SourceInfo, TBAAAccessInfo TargetInfo)
mergeTBAAInfoForCast - Get merged TBAA information for the purposes of type casts.
Definition: CodeGenModule.cpp:1047
clang::OMPThreadPrivateDecl
This represents '#pragma omp threadprivate ...' directive.
Definition: DeclOpenMP.h:110
clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes
void SetInternalFunctionAttributes(GlobalDecl GD, llvm::Function *F, const CGFunctionInfo &FI)
Set the attributes on the LLVM function for the given decl and function info.
Definition: CodeGenModule.cpp:2311
clang::CodeGen::CodeGenModule::HasHiddenLTOVisibility
bool HasHiddenLTOVisibility(const CXXRecordDecl *RD)
Returns whether the given record has hidden LTO visibility and therefore may participate in (single-m...
Definition: CGVTables.cpp:1236
clang::NamedDecl
This represents a decl that may have a name.
Definition: Decl.h:247
clang::CodeGen::CodeGenModule::getGlobalDtors
CtorList & getGlobalDtors()
Definition: CodeGenModule.h:773
TargetInfo.h
clang::MultiVersionKind::Target
@ Target
clang::CodeGen::CodeGenModule::getSize
llvm::ConstantInt * getSize(CharUnits numChars)
Emit the given number of characters as a value of type size_t.
Definition: CodeGenModule.cpp:1106
clang::CodeGen::ObjCEntrypoints::objc_autoreleaseReturnValue
llvm::Function * objc_autoreleaseReturnValue
id objc_autoreleaseReturnValue(id);
Definition: CodeGenModule.h:148
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:736
clang::CodeGen::CodeGenModule::setAtomicGetterHelperFnMap
void setAtomicGetterHelperFnMap(QualType Ty, llvm::Constant *Fn)
Definition: CodeGenModule.h:708
clang::GVALinkage
GVALinkage
A more specific kind of linkage than enum Linkage.
Definition: Linkage.h:73
clang::CodeGen::CodeGenModule::getContext
ASTContext & getContext() const
Definition: CodeGenModule.h:729
clang::CodeGen::CodeGenModule::AlwaysHasLTOVisibilityPublic
bool AlwaysHasLTOVisibilityPublic(const CXXRecordDecl *RD)
Returns whether the given record has public LTO visibility (regardless of -lto-whole-program-visibili...
Definition: CGVTables.cpp:1213
clang::DiagnosticsEngine
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:192
clang::CodeGen::BlockByrefHelpers::DisposeHelper
llvm::Constant * DisposeHelper
Definition: CodeGenModule.h:253
clang::CodeGen::CodeGenModule::getLLVMLinkageForDeclarator
llvm::GlobalValue::LinkageTypes getLLVMLinkageForDeclarator(const DeclaratorDecl *D, GVALinkage Linkage, bool IsConstantVariable)
Returns LLVM linkage for a declarator.
Definition: CodeGenModule.cpp:5162
clang::ast_matchers::type
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
Definition: ASTMatchersInternal.cpp:774
clang::CodeGen::CodeGenModule::AddCXXStermFinalizerToGlobalDtor
void AddCXXStermFinalizerToGlobalDtor(llvm::Function *StermFinalizer, int Priority)
Add an sterm finalizer to its own llvm.global_dtors entry.
Definition: CodeGenModule.h:1145
clang::TargetInfo
Exposes information about the current target.
Definition: TargetInfo.h:205
DeclCXX.h
clang::CodeGen::CodeGenModule::Release
void Release()
Finalize LLVM code generation.
Definition: CodeGenModule.cpp:510
Module.h
clang::CodeGen::CodeGenModule::getMinimumClassObjectSize
CharUnits getMinimumClassObjectSize(const CXXRecordDecl *CD)
Returns the minimum object size for an object of the given class type (or a class derived from it).
Definition: CGClass.cpp:58
clang::CodeGen::CodeGenModule::getTBAAInfoForSubobject
TBAAAccessInfo getTBAAInfoForSubobject(LValue Base, QualType AccessType)
getTBAAInfoForSubobject - Get TBAA information for an access with a given base lvalue.
Definition: CodeGenModule.h:813
DeclOpenMP.h
clang::CodeGen::OrderGlobalInitsOrStermFinalizers::operator<
bool operator<(const OrderGlobalInitsOrStermFinalizers &RHS) const
Definition: CodeGenModule.h:112
clang::NamedDecl::getLinkageAndVisibility
LinkageInfo getLinkageAndVisibility() const
Determines the linkage and visibility of this entity.
Definition: Decl.cpp:1176
clang::CodeGen::OrderGlobalInitsOrStermFinalizers::OrderGlobalInitsOrStermFinalizers
OrderGlobalInitsOrStermFinalizers(unsigned int p, unsigned int l)
Definition: CodeGenModule.h:105
clang::CodeGen::CodeGenModule::GetGlobalVarAddressSpace
LangAS GetGlobalVarAddressSpace(const VarDecl *D)
Return the AST address space of the underlying global variable for D, as determined by its declaratio...
Definition: CodeGenModule.cpp:4674
clang::ProfileList::ExclusionType
ExclusionType
Represents if an how something should be excluded from profiling.
Definition: ProfileList.h:31
clang::CodeGen::CodeGenModule::AddCXXStermFinalizerEntry
void AddCXXStermFinalizerEntry(llvm::FunctionCallee DtorFn)
Add an sterm finalizer to the C++ global cleanup function.
Definition: CodeGenModule.h:1139
clang::CodeGen::CodeGenModule::getGenericBlockLiteralType
llvm::Type * getGenericBlockLiteralType()
The type of a generic block literal.
Definition: CGBlocks.cpp:1144
clang::CodeGen::CodeGenModule::ReturnTypeUsesFPRet
bool ReturnTypeUsesFPRet(QualType ResultType)
Return true iff the given type uses 'fpret' when used as a return type.
Definition: CGCall.cpp:1583
clang::CodeGen::CodeGenModule::getHLSLRuntime
CGHLSLRuntime & getHLSLRuntime()
Return a reference to the configured HLSL runtime.
Definition: CodeGenModule.h:648
clang::CodeGen::BlockByrefHelpers::emitCopy
virtual void emitCopy(CodeGenFunction &CGF, Address dest, Address src)=0
llvm::SmallPtrSet< llvm::GlobalValue *, 10 >
clang::UnaryOperator
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2174
clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributes
void SetLLVMFunctionAttributes(GlobalDecl GD, const CGFunctionInfo &Info, llvm::Function *F, bool IsThunk)
Set the LLVM function attributes (sext, zext, etc).
Definition: CodeGenModule.cpp:1735
clang::CodeGen::CodeGenModule::getLangOpts
const LangOptions & getLangOpts() const
Definition: CodeGenModule.h:730
clang::LinkageInfo::isVisibilityExplicit
bool isVisibilityExplicit() const
Definition: Visibility.h:85
clang::CodeGen::CodeGenModule::getAtomicGetterHelperFnMap
llvm::Constant * getAtomicGetterHelperFnMap(QualType Ty)
Definition: CodeGenModule.h:705
clang::CodeGen::CodeGenModule::CreateGlobalInitOrCleanUpFunction
llvm::Function * CreateGlobalInitOrCleanUpFunction(llvm::FunctionType *ty, const Twine &name, const CGFunctionInfo &FI, SourceLocation Loc=SourceLocation(), bool TLS=false, llvm::GlobalVariable::LinkageTypes Linkage=llvm::GlobalVariable::InternalLinkage)
Definition: CGDeclCXX.cpp:427
clang::CodeGen::CodeGenModule::EmitMainVoidAlias
void EmitMainVoidAlias()
Emit an alias for "main" if it has no arguments (needed for wasm).
Definition: CodeGenModule.cpp:6668
clang::CodeGen::CodeGenModule::getTargetCodeGenInfo
const TargetCodeGenInfo & getTargetCodeGenInfo()
Definition: TargetInfo.cpp:12192
clang::CodeGen::CodeGenModule::ReturnSlotInterferesWithArgs
bool ReturnSlotInterferesWithArgs(const CGFunctionInfo &FI)
Return true iff the given type uses an argument slot when 'sret' is used as a return type.
Definition: CGCall.cpp:1578
clang::CoverageSourceInfo
Stores additional source code information like skipped ranges which is required by the coverage mappi...
Definition: CoverageMappingGen.h:62
clang::CodeGen::ObjCEntrypoints::objc_autoreleasePoolPush
llvm::Function * objc_autoreleasePoolPush
void *objc_autoreleasePoolPush(void);
Definition: CodeGenModule.h:138
clang::CodeGen::CodeGenModule::computeNonVirtualBaseClassOffset
CharUnits computeNonVirtualBaseClassOffset(const CXXRecordDecl *DerivedClass, CastExpr::path_const_iterator Start, CastExpr::path_const_iterator End)
Definition: CGClass.cpp:170
End
SourceLocation End
Definition: USRLocFinder.cpp:167
clang::CodeGen::InstrProfStats::addMismatched
void addMismatched(bool MainFile)
Record that a function we've visited has mismatched profile data.
Definition: CodeGenModule.h:240
clang::ProtectedVisibility
@ ProtectedVisibility
Objects with "protected" visibility are seen by the dynamic linker but always dynamically resolve to ...
Definition: Visibility.h:41
clang::CodeGen::CodeGenModule::EmitAnnotationUnit
llvm::Constant * EmitAnnotationUnit(SourceLocation Loc)
Emit the annotation's translation unit.
Definition: CodeGenModule.cpp:2863
clang::CodeGen::CodeGenModule::getPGOReader
llvm::IndexedInstrProfReader * getPGOReader() const
Definition: CodeGenModule.h:665
clang::CodeGen::CodeGenModule::getMangledName
StringRef getMangledName(GlobalDecl GD)
Definition: CodeGenModule.cpp:1545
clang::CodeGen::CodeGenModule::ConstructAttributeList
void ConstructAttributeList(StringRef Name, const CGFunctionInfo &Info, CGCalleeInfo CalleeInfo, llvm::AttributeList &Attrs, unsigned &CallingConv, bool AttrOnCallSite, bool IsThunk)
Get the LLVM attributes and calling convention to use for a particular function type.
Definition: CGCall.cpp:2125
clang::CodeGen::CodeGenModule::EmitGlobal
void EmitGlobal(GlobalDecl D)
Emit code for a single global function or var decl.
Definition: CodeGenModule.cpp:3267
clang::CodeGen::CodeGenModule::setDLLImportDLLExport
void setDLLImportDLLExport(llvm::GlobalValue *GV, GlobalDecl D) const
Definition: CodeGenModule.cpp:1247
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1566
clang::CodeGen::CodeGenModule::setGlobalVisibility
void setGlobalVisibility(llvm::GlobalValue *GV, const NamedDecl *D) const
Set the visibility for the given LLVM GlobalValue.
Definition: CodeGenModule.cpp:1110
clang::CodeGen::BlockByrefHelpers::needsDispose
virtual bool needsDispose() const
Definition: CodeGenModule.h:274
DeclObjC.h
Offset
unsigned Offset
Definition: Format.cpp:2774
clang::CodeGen::CodeGenModule::getOpenMPRuntime
CGOpenMPRuntime & getOpenMPRuntime()
Return a reference to the configured OpenMP runtime.
Definition: CodeGenModule.h:636
ABI.h
clang::CodeGen::CodeGenModule::GlobalUniqueCount
int GlobalUniqueCount
Definition: CodeGenModule.h:566
clang::CodeGen::CodeGenModule::GetGlobalValue
llvm::GlobalValue * GetGlobalValue(StringRef Ref)
Definition: CodeGenModule.cpp:1628
clang::GlobalDecl
GlobalDecl - represents a global declaration.
Definition: GlobalDecl.h:56
clang::CodeGen::CodeGenModule::GetFunctionStart
llvm::Constant * GetFunctionStart(const ValueDecl *Decl)
Definition: CodeGenModule.cpp:4227
clang::CodeGen::CodeGenModule::GenKernelArgMetadata
void GenKernelArgMetadata(llvm::Function *FN, const FunctionDecl *FD=nullptr, CodeGenFunction *CGF=nullptr)
OpenCL v1.2 s5.6.4.6 allows the compiler to store kernel argument information in the program executab...
Definition: CodeGenModule.cpp:1791
clang::CodeGen::CodeGenModule::setAddrOfConstantCompoundLiteral
void setAddrOfConstantCompoundLiteral(const CompoundLiteralExpr *CLE, llvm::GlobalVariable *GV)
Notes that CLE's GlobalVariable is GV.
Definition: CGExprConstant.cpp:2206
clang::CodeGen::CodeGenModule::GetGlobalConstantAddressSpace
LangAS GetGlobalConstantAddressSpace() const
Return the AST address space of constant literal, which is used to emit the constant literal as globa...
Definition: CodeGenModule.cpp:4712
clang::CodeGen::CodeGenModule::EmitTopLevelDecl
void EmitTopLevelDecl(Decl *D)
Emit code for a single top level declaration.
Definition: CodeGenModule.cpp:6282
clang::CodeGen::ObjCEntrypoints::clang_arc_use
llvm::Function * clang_arc_use
void clang.arc.use(...);
Definition: CodeGenModule.h:208
clang::CodeGen::AlignmentSource::Decl
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
clang::CodeGen::CodeGenModule::stopAutoInit
bool stopAutoInit()
Definition: CodeGenModule.cpp:7127
clang::CodeGen::CodeGenModule::getItaniumVTableContext
const ItaniumVTableContext & getItaniumVTableContext() const
Definition: CodeGenModule.h:764
clang::CodeGen::CodeGenModule::printPostfixForExternalizedDecl
void printPostfixForExternalizedDecl(llvm::raw_ostream &OS, const Decl *D) const
Print the postfix for externalized static variable or kernels for single source offloading languages ...
Definition: CodeGenModule.cpp:7152
clang::dataflow::Literal
uint32_t Literal
Literals are represented as positive integers.
Definition: WatchedLiteralsSolver.cpp:55
U
clang::CodeGen::CodeGenModule::getOrCreateStaticVarDecl
llvm::Constant * getOrCreateStaticVarDecl(const VarDecl &D, llvm::GlobalValue::LinkageTypes Linkage)
Definition: CGDecl.cpp:244
clang::CodeGen::ObjCEntrypoints::objc_copyWeak
llvm::Function * objc_copyWeak
void objc_copyWeak(id *dest, id *src);
Definition: CodeGenModule.h:151
clang::CodeGen::InstrProfStats::addMissing
void addMissing(bool MainFile)
Record that a function we've visited has no profile data.
Definition: CodeGenModule.h:234
V
#define V(N, I)
Definition: ASTContext.h:3211
clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString
ConstantAddress GetAddrOfConstantCFString(const StringLiteral *Literal)
Return a pointer to a constant CFString object for the given string.
Definition: CodeGenModule.cpp:5607
clang::CodeGen::CodeGenModule::AddDependentLib
void AddDependentLib(StringRef Lib)
Appends a dependent lib to the appropriate metadata value.
Definition: CodeGenModule.cpp:2581
clang::CodeGen::CodeGenTypeCache
This structure provides a set of types that are commonly used during IR emission.
Definition: CodeGenTypeCache.h:32
clang::CodeGen::CodeGenModule::EmitOMPDeclareMapper
void EmitOMPDeclareMapper(const OMPDeclareMapperDecl *D, CodeGenFunction *CGF=nullptr)
Emit a code for declare mapper construct.
Definition: CGDecl.cpp:2636
clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition
void SetLLVMFunctionAttributesForDefinition(const Decl *D, llvm::Function *F)
Set the LLVM function attributes which only apply to a function definition.
Definition: CodeGenModule.cpp:2000
clang::CodeGen::TBAAAccessInfo
Definition: CodeGenTBAA.h:41
clang::CodeGen::ObjCEntrypoints::retainAutoreleasedReturnValueMarker
llvm::InlineAsm * retainAutoreleasedReturnValueMarker
A void(void) inline asm to use to mark that the return value of a call will be immediately retain.
Definition: CodeGenModule.h:205
clang::CodeGen::CodeGenModule::CreateMetadataIdentifierForType
llvm::Metadata * CreateMetadataIdentifierForType(QualType T)
Create a metadata identifier for the given type.
Definition: CodeGenModule.cpp:6959
clang::CodeGen::CodeGenModule::getAddrOfGlobalBlockIfEmitted
llvm::Constant * getAddrOfGlobalBlockIfEmitted(const BlockExpr *BE)
Returns the address of a block which requires no caputres, or null if we've yet to emit the block for...
Definition: CodeGenModule.h:1006
clang::Module
Describes a module or submodule.
Definition: Module.h:98
clang::CodeGen::CodeGenModule::finalizeKCFITypes
void finalizeKCFITypes()
Emit KCFI type identifier constants and remove unused identifiers.
Definition: CodeGenModule.cpp:2375
clang::CodeGen::SanitizerMetadata
Definition: SanitizerMetadata.h:32
clang::CodeGen::CoverageMappingModuleGen
Organizes the cross-function state that is used while generating code coverage mapping data.
Definition: CoverageMappingGen.h:96
clang::OMPDeclareReductionDecl
This represents '#pragma omp declare reduction ...' directive.
Definition: DeclOpenMP.h:171
clang::CodeGen::CodeGenModule::getVBaseAlignment
CharUnits getVBaseAlignment(CharUnits DerivedAlign, const CXXRecordDecl *Derived, const CXXRecordDecl *VBase)
Returns the assumed alignment of a virtual base of a class.
Definition: CGClass.cpp:75
clang::Linkage
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
Definition: Linkage.h:23
clang::CodeGen::ObjCEntrypoints::objc_release
llvm::Function * objc_release
void objc_release(id);
Definition: CodeGenModule.h:188
clang::CodeGen::CodeGenModule::getObjCRuntime
CGObjCRuntime & getObjCRuntime()
Return a reference to the configured Objective-C runtime.
Definition: CodeGenModule.h:619
clang::BlockDecl
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4332
clang::CodeGen::CodeGenModule::getClassPointerAlignment
CharUnits getClassPointerAlignment(const CXXRecordDecl *CD)
Returns the assumed alignment of an opaque pointer to the given class.
Definition: CGClass.cpp:39
clang::CodeGen::CodeGenModule::getSanStats
llvm::SanitizerStatReport & getSanStats()
Definition: CodeGenModule.cpp:7037
clang::CodeGen::BlockByrefHelpers
A pair of helper functions for a __block variable.
Definition: CodeGenModule.h:248
clang::CodeGen::CodeGenModule::isPaddedAtomicType
bool isPaddedAtomicType(QualType type)
Definition: CodeGenTypes.cpp:835
clang::CodeGen::CodeGenModule::getNaturalPointeeTypeAlignment
CharUnits getNaturalPointeeTypeAlignment(QualType T, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr)
Definition: CodeGenModule.cpp:7055
clang::CodeGen::CodeGenModule::setTypeDescriptorInMap
void setTypeDescriptorInMap(QualType Ty, llvm::Constant *C)
Definition: CodeGenModule.h:716
clang::CodeGen::CodeGenModule::getMangledNameDecl
const GlobalDecl getMangledNameDecl(StringRef)
Definition: CodeGenModule.cpp:1618
clang::CodeGen::CodeGenModule::ReturnTypeUsesSRet
bool ReturnTypeUsesSRet(const CGFunctionInfo &FI)
Return true iff the given type uses 'sret' when used as a return type.
Definition: CGCall.cpp:1573
clang::CodeGen::CodeGenModule::getCodeGenOpts
const CodeGenOptions & getCodeGenOpts() const
Definition: CodeGenModule.h:738
clang::CodeGen::CodeGenModule::CreateKCFITypeId
llvm::ConstantInt * CreateKCFITypeId(QualType T)
Generate a KCFI type identifier for T.
Definition: CodeGenModule.cpp:1721
clang::CodeGen::CodeGenModule::createUnnamedGlobalFrom
Address createUnnamedGlobalFrom(const VarDecl &D, llvm::Constant *Constant, CharUnits Align)
Definition: CGDecl.cpp:1117
clang::MaterializeTemporaryExpr
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4562
clang::CodeGen::CodeGenModule::getMinimumObjectSize
CharUnits getMinimumObjectSize(QualType Ty)
Returns the minimum object size for an object of the given type.
Definition: CodeGenModule.h:960
clang::index::SymbolKind::Module
@ Module
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:182
clang::CodeGen::CodeGenModule::EmitAnnotationArgs
llvm::Constant * EmitAnnotationArgs(const AnnotateAttr *Attr)
Emit additional args of the annotation.
Definition: CodeGenModule.cpp:2879
clang::CodeGen::CodeGenModule::maybeSetTrivialComdat
void maybeSetTrivialComdat(const Decl &D, llvm::GlobalObject &GO)
Definition: CodeGenModule.cpp:4812
LangOptions.h
clang::CodeGen::InstrProfStats::addVisited
void addVisited(bool MainFile)
Record that we've visited a function and whether or not that function was in the main source file.
Definition: CodeGenModule.h:228
clang::CodeGen::CodeGenModule::getTBAABaseTypeInfo
llvm::MDNode * getTBAABaseTypeInfo(QualType QTy)
getTBAABaseTypeInfo - Get metadata that describes the given base access type.
Definition: CodeGenModule.cpp:1035
clang::CodeGen::CodeGenVTables::getMicrosoftVTableContext
MicrosoftVTableContext & getMicrosoftVTableContext()
Definition: CGVTables.h:109
clang::CodeGen::CodeGenModule::RefreshTypeCacheForClass
void RefreshTypeCacheForClass(const CXXRecordDecl *Class)
Definition: CodeGenModule.cpp:992
clang::CodeGen::BlockByrefHelpers::needsCopy
virtual bool needsCopy() const
Definition: CodeGenModule.h:271
clang::CodeGen::CodeGenModule::getGlobalCtors
CtorList & getGlobalCtors()
Definition: CodeGenModule.h:772
clang::CodeGen::CodeGenModule::GetAddrOfGlobal
llvm::Constant * GetAddrOfGlobal(GlobalDecl GD, ForDefinition_t IsForDefinition=NotForDefinition)
Definition: CodeGenModule.cpp:4543
clang::CodeGen::ObjCEntrypoints::objc_storeStrong
llvm::Function * objc_storeStrong
void objc_storeStrong(id*, id);
Definition: CodeGenModule.h:195
clang::CodeGen::InstrProfStats::InstrProfStats
InstrProfStats()
Definition: CodeGenModule.h:223
clang::CodeGen::CodeGenModule::getVTableComponentType
llvm::Type * getVTableComponentType() const
Definition: CGVTables.cpp:690
clang::CodeGen::CodeGenModule::getTBAAVTablePtrAccessInfo
TBAAAccessInfo getTBAAVTablePtrAccessInfo(llvm::Type *VTablePtrType)
getTBAAVTablePtrAccessInfo - Get the TBAA information that describes an access to a virtual table poi...
Definition: CodeGenModule.cpp:1023
clang::CodeGen::CodeGenModule::CreateOrReplaceCXXRuntimeVariable
llvm::GlobalVariable * CreateOrReplaceCXXRuntimeVariable(StringRef Name, llvm::Type *Ty, llvm::GlobalValue::LinkageTypes Linkage, llvm::Align Alignment)
Will return a global variable of the given type.
Definition: CodeGenModule.cpp:4568
clang::CodeGen::CodeGenModule::getModule
llvm::Module & getModule() const
Definition: CodeGenModule.h:739
clang::MSGuidDecl
A global _GUID constant.
Definition: DeclCXX.h:4200
clang::CXXDestructorDecl
Represents a C++ destructor within a class.
Definition: DeclCXX.h:2715
clang::CodeGen::CGDebugInfo
This class gathers all debug information during compilation and is responsible for emitting to llvm g...
Definition: CGDebugInfo.h:55
clang::CodeGen::CodeGenModule::~CodeGenModule
~CodeGenModule()
Definition: CodeGenModule.cpp:215
clang::CodeGen::CodeGenModule::shouldUseTBAA
bool shouldUseTBAA() const
Definition: CodeGenModule.h:752
clang::CodeGen::CodeGenModule::setFunctionLinkage
void setFunctionLinkage(GlobalDecl GD, llvm::Function *F)
Definition: CodeGenModule.h:1304
clang::CodeGen::CodeGenModule::EmitTentativeDefinition
void EmitTentativeDefinition(const VarDecl *D)
Definition: CodeGenModule.cpp:4642
clang::CallingConv
CallingConv
CallingConv - Specifies the calling convention that a function uses.
Definition: Specifiers.h:266
clang::CodeGen::CGOpenCLRuntime
Definition: CGOpenCLRuntime.h:36
clang::VarDecl
Represents a variable declaration or definition.
Definition: Decl.h:915
clang::CodeGen::CodeGenModule::EmitDeferredUnusedCoverageMappings
void EmitDeferredUnusedCoverageMappings()
Emit all the deferred coverage mappings for the uninstrumented functions.
Definition: CodeGenModule.cpp:6628
clang::CodeGen::CodeGenModule::AddGlobalAnnotations
void AddGlobalAnnotations(const ValueDecl *D, llvm::GlobalValue *GV)
Add global annotations that are set on D, for the global GV.
Definition: CodeGenModule.cpp:2940
clang::CodeGen::CodeGenModule::imbueXRayAttrs
bool imbueXRayAttrs(llvm::Function *Fn, SourceLocation Loc, StringRef Category=StringRef()) const
Imbue XRay attributes to a function, applying the always/never attribute lists in the process.
Definition: CodeGenModule.cpp:2999
clang::CodeGen::CodeGenModule::Structor::Initializer
llvm::Constant * Initializer
Definition: CodeGenModule.h:295
clang::CodeGen::CodeGenModule::EmitOMPAllocateDecl
void EmitOMPAllocateDecl(const OMPAllocateDecl *D)
Emit a code for the allocate directive.
Definition: CGDecl.cpp:2648
clang::TagDecl
Represents the declaration of a struct/union/class/enum.
Definition: Decl.h:3436
clang::OMPDeclareMapperDecl
This represents '#pragma omp declare mapper ...' directive.
Definition: DeclOpenMP.h:286
clang::CodeGen::CodeGenModule::EmitOMPThreadPrivateDecl
void EmitOMPThreadPrivateDecl(const OMPThreadPrivateDecl *D)
Emit a code for threadprivate directive.
Definition: CodeGenModule.cpp:6912
clang::StringLiteral
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1778
clang::CodeGen::CodeGenModule::getTypes
CodeGenTypes & getTypes()
Definition: CodeGenModule.h:756
clang::CodeGen::CodeGenModule::getCoverageMapping
CoverageMappingModuleGen * getCoverageMapping() const
Definition: CodeGenModule.h:667
llvm::DenseSet
Definition: Sema.h:77
clang::Type::getAsCXXRecordDecl
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
Definition: Type.cpp:1783
NoSanitizeList.h
clang::CodeGen::CodeGenModule::getBlockObjectDispose
llvm::FunctionCallee getBlockObjectDispose()
Definition: CGBlocks.cpp:2859
clang::CodeGen::CodeGenModule::GetOrCreateRTTIProxyGlobalVariable
llvm::GlobalVariable * GetOrCreateRTTIProxyGlobalVariable(llvm::Constant *Addr)
Definition: CodeGenModule.cpp:1985
clang::CodeGen::CodeGenModule::GetAddrOfConstantCompoundLiteral
ConstantAddress GetAddrOfConstantCompoundLiteral(const CompoundLiteralExpr *E)
Returns a pointer to a constant global variable for the given file-scope compound literal expression.
Definition: CGExprConstant.cpp:2214
clang::CodeGen::Address
An aligned address.
Definition: Address.h:74
Base
clang::CodeGen::CodeGenModule::clear
void clear()
Definition: CodeGenModule.cpp:444
clang::ObjCEncodeExpr
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:409
clang::CodeGen::CodeGenModule::GetAddrOfGlobalBlock
llvm::Constant * GetAddrOfGlobalBlock(const BlockExpr *BE, StringRef Name)
Gets the address of a block which requires no captures.
Definition: CGBlocks.cpp:1288
clang::CodeGen::CodeGenModule::Structor
Definition: CodeGenModule.h:285
clang::CodeGen::CodeGenModule::AddCXXPrioritizedStermFinalizerEntry
void AddCXXPrioritizedStermFinalizerEntry(llvm::Function *StermFinalizer, int Priority)
Definition: CodeGenModule.h:1150
clang::CodeGen::CodeGenModule::AppendLinkerOptions
void AppendLinkerOptions(StringRef Opts)
Appends Opts to the "llvm.linker.options" metadata value.
Definition: CodeGenModule.cpp:2567
clang::CodeGen::CodeGenModule::getAddrAndTypeOfCXXStructor
llvm::FunctionCallee getAddrAndTypeOfCXXStructor(GlobalDecl GD, const CGFunctionInfo *FnInfo=nullptr, llvm::FunctionType *FnType=nullptr, bool DontDefer=false, ForDefinition_t IsForDefinition=NotForDefinition)
Definition: CGCXX.cpp:221
clang::CodeGen::OrderGlobalInitsOrStermFinalizers::operator==
bool operator==(const OrderGlobalInitsOrStermFinalizers &RHS) const
Definition: CodeGenModule.h:108
clang::CodeGen::CodeGenModule::getAtomicSetterHelperFnMap
llvm::Constant * getAtomicSetterHelperFnMap(QualType Ty)
Definition: CodeGenModule.h:697
clang::CodeGenOptions
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
Definition: CodeGenOptions.h:49
clang::CodeGen::ObjCEntrypoints::objc_autorelease
llvm::Function * objc_autorelease
id objc_autorelease(id);
Definition: CodeGenModule.h:141
clang::CodeGen::CodeGenModule::EmitVTableTypeMetadata
void EmitVTableTypeMetadata(const CXXRecordDecl *RD, llvm::GlobalVariable *VTable, const VTableLayout &VTLayout)
Emit type metadata for the given vtable using the given layout.
Definition: CGVTables.cpp:1286
clang::CodeGen::ObjCEntrypoints::objc_retainAutorelease
llvm::Function * objc_retainAutorelease
id objc_retainAutorelease(id);
Definition: CodeGenModule.h:176
clang::TemplateParamObjectDecl
A template parameter object.
Definition: DeclTemplate.h:3365
clang::LinkageInfo::getVisibility
Visibility getVisibility() const
Definition: Visibility.h:84
clang::CodeGen::CodeGenModule::HandleCXXStaticMemberVarInstantiation
void HandleCXXStaticMemberVarInstantiation(VarDecl *VD)
Tell the consumer that this variable has been instantiated.
Definition: CodeGenModule.cpp:5355
clang::CodeGen::CodeGenModule::getTarget
const TargetInfo & getTarget() const
Definition: CodeGenModule.h:744
clang::LangOptions::isAllDefaultVisibilityExportMapping
bool isAllDefaultVisibilityExportMapping() const
Definition: LangOptions.h:634
clang::CodeGen::CodeGenModule::ByrefHelpersCache
llvm::FoldingSet< BlockByrefHelpers > ByrefHelpersCache
Definition: CodeGenModule.h:990
clang::CodeGen::ObjCEntrypoints::objc_alloc_init
llvm::FunctionCallee objc_alloc_init
void objc_alloc_init(id);
Definition: CodeGenModule.h:128
clang::TopLevelStmtDecl
A declaration that models statements at global scope.
Definition: Decl.h:4306
clang::Visibility
Visibility
Describes the different kinds of visibility that a declaration may have.
Definition: Visibility.h:33
clang::CodeGen::CodeGenModule::getModuleDebugInfo
CGDebugInfo * getModuleDebugInfo()
Definition: CodeGenModule.h:720
clang::CodeGen::CodeGenModule::getBlockDescriptorType
llvm::Type * getBlockDescriptorType()
Fetches the type of a generic block descriptor.
Definition: CGBlocks.cpp:1112
clang::CodeGen::ObjCEntrypoints::objc_retain
llvm::Function * objc_retain
id objc_retain(id);
Definition: CodeGenModule.h:169
clang::CodeGen::CodeGenModule::EmitGlobalAnnotations
void EmitGlobalAnnotations()
Emit all the global annotations.
Definition: CodeGenModule.cpp:2833
clang::CodeGen::CodeGenModule::CreateCrossDsoCfiTypeId
llvm::ConstantInt * CreateCrossDsoCfiTypeId(llvm::Metadata *MD)
Generate a cross-DSO type identifier for MD.
Definition: CodeGenModule.cpp:1714
clang::CodeGen::CodeGenModule::GetTargetTypeStoreSize
CharUnits GetTargetTypeStoreSize(llvm::Type *Ty) const
Return the store size, in character units, of the given LLVM type.
Definition: CodeGenModule.cpp:4669
clang::CodeGen::ObjCEntrypoints::objc_initWeak
llvm::Function * objc_initWeak
id objc_initWeak(id*, id);
Definition: CodeGenModule.h:157
clang::CodeGen::CodeGenModule::GetConstantArrayFromStringLiteral
llvm::Constant * GetConstantArrayFromStringLiteral(const StringLiteral *E)
Return a constant array for the given string.
Definition: CodeGenModule.cpp:5840
clang::LangAS
LangAS
Defines the address space values used by the address space qualifier of QualType.
Definition: AddressSpaces.h:25
clang::CodeGen::CodeGenModule::IsPlatformVersionAtLeastFn
llvm::FunctionCallee IsPlatformVersionAtLeastFn
Definition: CodeGenModule.h:662
clang::CodeGen::CodeGenModule::getDataLayout
const llvm::DataLayout & getDataLayout() const
Definition: CodeGenModule.h:741
clang::CompoundLiteralExpr
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3412
clang::CodeGen::ObjCEntrypoints::objc_autoreleasePoolPopInvoke
llvm::FunctionCallee objc_autoreleasePoolPopInvoke
void objc_autoreleasePoolPop(void*); Note this method is used when we are using exception handling
Definition: CodeGenModule.h:135
clang::CXXRecordDecl
Represents a C++ struct/union/class.
Definition: DeclCXX.h:254
clang::CodeGen::CodeGenModule::getFileSystem
const IntrusiveRefCntPtr< llvm::vfs::FileSystem > & getFileSystem() const
Definition: CodeGenModule.h:731
clang::CodeGen::CodeGenModule::shouldMapVisibilityToDLLExport
bool shouldMapVisibilityToDLLExport(const NamedDecl *D) const
Definition: CodeGenModule.h:840
clang::CodeGen::LValue
LValue - This represents an lvalue references.
Definition: CGValue.h:171
clang::CodeGen::CodeGenModule::GetAddrOfTemplateParamObject
ConstantAddress GetAddrOfTemplateParamObject(const TemplateParamObjectDecl *TPO)
Get the address of a template parameter object.
Definition: CodeGenModule.cpp:3209
clang::CodeGen::CodeGenModule::getMicrosoftVTableContext
MicrosoftVTableContext & getMicrosoftVTableContext()
Definition: CodeGenModule.h:768
clang::LangOptions::hasDefaultVisibilityExportMapping
bool hasDefaultVisibilityExportMapping() const
Definition: LangOptions.h:624
clang::CodeGen::CodeGenModule::getNSConcreteGlobalBlock
llvm::Constant * getNSConcreteGlobalBlock()
Definition: CGBlocks.cpp:2885
clang::CastExpr::path_const_iterator
const typedef CXXBaseSpecifier *const * path_const_iterator
Definition: Expr.h:3549
clang::CodeGen::BlockByrefHelpers::Alignment
CharUnits Alignment
The alignment of the field.
Definition: CodeGenModule.h:258
clang::CodeGen::CodeGenModule::AddDeferredUnusedCoverageMapping
void AddDeferredUnusedCoverageMapping(Decl *D)
Stored a deferred empty coverage mapping for an unused and thus uninstrumented top level declaration.
Definition: CodeGenModule.cpp:6587
clang::CodeGen::CodeGenModule::getTerminateFn
llvm::FunctionCallee getTerminateFn()
Get the declaration of std::terminate for the platform.
Definition: CGException.cpp:63
clang::CodeGen::CodeGenModule::EmitExplicitCastExprType
void EmitExplicitCastExprType(const ExplicitCastExpr *E, CodeGenFunction *CGF=nullptr)
Emit type info if type of an expression is a variably modified type.
Definition: CGExpr.cpp:1024
clang::CodeGen::CodeGenModule::setStaticLocalDeclAddress
void setStaticLocalDeclAddress(const VarDecl *D, llvm::Constant *C)
Definition: CodeGenModule.h:674
clang::CodeGen::CodeGenModule::ErrorUnsupported
void ErrorUnsupported(const Stmt *S, const char *Type)
Print out an error that codegen doesn't support the specified stmt yet.
Definition: CodeGenModule.cpp:1089
clang::CodeGen::CodeGenModule::GetAddrOfConstantString
ConstantAddress GetAddrOfConstantString(const StringLiteral *Literal)
Return a pointer to a constant NSString object for the given string.
clang::CodeGen::CodeGenModule::CreateMetadataIdentifierForVirtualMemPtrType
llvm::Metadata * CreateMetadataIdentifierForVirtualMemPtrType(QualType T)
Create a metadata identifier that is intended to be used to check virtual calls via a member function...
Definition: CodeGenModule.cpp:6964
clang::CodeGen::CodeGenFunction
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
Definition: CodeGenFunction.h:232
clang::CodeGen::CodeGenModule::getBuiltinLibFunction
llvm::Constant * getBuiltinLibFunction(const FunctionDecl *FD, unsigned BuiltinID)
Given a builtin id for a function like "__builtin_fabsf", return a Function* for "fabsf".
Definition: CGBuiltin.cpp:91
clang::CodeGen::CodeGenModule::getObjCFastEnumerationStateType
QualType getObjCFastEnumerationStateType()
Retrieve the record type that describes the state of an Objective-C fast enumeration loop (for....
Definition: CodeGenModule.cpp:5806
clang::ValueDecl
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:703
SanitizerMetadata.h
clang::CodeGen::CodeGenModule::CreateRuntimeVariable
llvm::Constant * CreateRuntimeVariable(llvm::Type *Ty, StringRef Name)
Create a new runtime global variable with the specified type and name.
Definition: CodeGenModule.cpp:4633
clang::CodeGen::CodeGenModule::getCXXABI
CGCXXABI & getCXXABI() const
Definition: CodeGenModule.h:749
clang::CodeGen::CodeGenModule::Structor::Structor
Structor()
Definition: CodeGenModule.h:286
clang::CodeGen::CodeGenModule::getMostBaseClasses
std::vector< const CXXRecordDecl * > getMostBaseClasses(const CXXRecordDecl *RD)
Return a vector of most-base classes for RD.
Definition: CodeGenModule.cpp:1970
clang::CodeGen::CodeGenModule::GetNonVirtualBaseClassOffset
llvm::Constant * GetNonVirtualBaseClassOffset(const CXXRecordDecl *ClassDecl, CastExpr::path_const_iterator PathBegin, CastExpr::path_const_iterator PathEnd)
Returns the offset from a derived class to a class.
Definition: CGClass.cpp:198
clang::CodeGen::CodeGenModule
This class organizes the cross-function state that is used while generating LLVM code.
Definition: CodeGenModule.h:280
clang::CodeGen::CodeGenModule::getIntrinsic
llvm::Function * getIntrinsic(unsigned IID, ArrayRef< llvm::Type * > Tys=std::nullopt)
Definition: CodeGenModule.cpp:5566
clang::ItaniumVTableContext
Definition: VTableBuilder.h:363
clang::CodeGen::CodeGenModule::GetAddrOfRTTIDescriptor
llvm::Constant * GetAddrOfRTTIDescriptor(QualType Ty, bool ForEH=false)
Get the address of the RTTI descriptor for the given type.
Definition: CodeGenModule.cpp:6895
clang::CodeGen::CodeGenModule::setDSOLocal
void setDSOLocal(llvm::GlobalValue *GV) const
Definition: CodeGenModule.cpp:1243
clang::BlockExpr
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5973
llvm::ArrayRef
Definition: LLVM.h:34
clang::CodeGen::CodeGenModule::getVTables
CodeGenVTables & getVTables()
Definition: CodeGenModule.h:758
clang::CodeGen::CodeGenModule::EmitOMPDeclareReduction
void EmitOMPDeclareReduction(const OMPDeclareReductionDecl *D, CodeGenFunction *CGF=nullptr)
Emit a code for declare reduction construct.
Definition: CGDecl.cpp:2629
Value
Value
Definition: UninitializedValues.cpp:102
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:83
clang::CodeGen::CodeGenModule::GetAddrOfMSGuidDecl
ConstantAddress GetAddrOfMSGuidDecl(const MSGuidDecl *GD)
Get the address of a GUID.
Definition: CodeGenModule.cpp:3125
clang::DeclaratorDecl
Represents a ValueDecl that came out of a declarator.
Definition: Decl.h:767
clang::CodeGen::CodeGenModule::getTriple
const llvm::Triple & getTriple() const
Definition: CodeGenModule.h:745
clang::CodeGen::CodeGenModule::isFunctionBlockedFromProfileInstr
ProfileList::ExclusionType isFunctionBlockedFromProfileInstr(llvm::Function *Fn, SourceLocation Loc) const
Definition: CodeGenModule.cpp:3050
clang::CodeGen::CodeGenModule::MayDropFunctionReturn
bool MayDropFunctionReturn(const ASTContext &Context, QualType ReturnType) const
Whether this function's return type has no side effects, and thus may be trivially discarded if it is...
Definition: CGCall.cpp:1787
clang::CodeGen::ObjCEntrypoints::objc_loadWeak
llvm::Function * objc_loadWeak
id objc_loadWeak(id*);
Definition: CodeGenModule.h:160
CodeGenTypes.h
clang::CodeGen::CodeGenModule::CreateFunctionTypeMetadataForIcall
void CreateFunctionTypeMetadataForIcall(const FunctionDecl *FD, llvm::Function *F)
Create and attach type metadata to the given function.
Definition: CodeGenModule.cpp:2334
clang::CodeGen::CodeGenModule::setKCFIType
void setKCFIType(const FunctionDecl *FD, llvm::Function *F)
Set type metadata to the given function.
Definition: CodeGenModule.cpp:2355
clang::CodeGen::CodeGenModule::setLLVMFunctionFEnvAttributes
void setLLVMFunctionFEnvAttributes(const FunctionDecl *D, llvm::Function *F)
Set the LLVM function attributes that represent floating point environment.
Definition: CodeGenModule.cpp:2165
clang::CodeGen::CodeGenModule::getStaticLocalDeclAddress
llvm::Constant * getStaticLocalDeclAddress(const VarDecl *D)
Definition: CodeGenModule.h:671
clang::MicrosoftVTableContext
Definition: VTableBuilder.h:544
clang::CodeGen::CodeGenModule::ReturnTypeUsesFP2Ret
bool ReturnTypeUsesFP2Ret(QualType ResultType)
Return true iff the given type uses 'fp2ret' when used as a return type.
Definition: CGCall.cpp:1600
clang::CodeGen::ObjCEntrypoints::objc_destroyWeak
llvm::Function * objc_destroyWeak
void objc_destroyWeak(id*);
Definition: CodeGenModule.h:154
clang::CodeGen::OrderGlobalInitsOrStermFinalizers::lex_order
unsigned int lex_order
Definition: CodeGenModule.h:104
clang::CodeGen::ForDefinition
@ ForDefinition
Definition: CodeGenModule.h:99
clang::CodeGen::CodeGenModule::getBlockObjectAssign
llvm::FunctionCallee getBlockObjectAssign()
Definition: CGBlocks.cpp:2872
clang::CodeGen::CodeGenModule::EmitVTable
void EmitVTable(CXXRecordDecl *Class)
This is a callback from Sema to tell us that a particular vtable is required to be emitted in this tr...
Definition: CGVTables.cpp:1123
clang::CodeGen::CodeGenTypes
This class organizes the cross-module state that is used while lowering AST types to LLVM types.
Definition: CodeGenTypes.h:54
clang::CodeGen::ObjCEntrypoints::objc_releaseRuntimeFunction
llvm::FunctionCallee objc_releaseRuntimeFunction
void objc_release(id); Note this is the runtime method not the intrinsic.
Definition: CodeGenModule.h:192
clang::CodeGen::ObjCEntrypoints::objc_retainRuntimeFunction
llvm::FunctionCallee objc_retainRuntimeFunction
id objc_retain(id); Note this is the runtime method not the intrinsic.
Definition: CodeGenModule.h:173
clang::CodeGen::CodeGenModule::GetDefaultLLVMTLSModel
llvm::GlobalVariable::ThreadLocalMode GetDefaultLLVMTLSModel() const
Get LLVM TLS mode from CodeGenOptions.
Definition: CodeGenModule.cpp:1298
clang::CodeGen::BlockByrefHelpers::Profile
void Profile(llvm::FoldingSetNodeID &id) const
Definition: CodeGenModule.h:265
clang::CodeGen::CodeGenModule::addDefaultFunctionDefinitionAttributes
void addDefaultFunctionDefinitionAttributes(llvm::Function &F)
Adds attributes to F according to our CodeGenOptions and LangOptions, as though we had emitted it our...
Definition: CGCall.cpp:1987
clang::CodeGen::CodeGenModule::getTBAAAccessInfo
TBAAAccessInfo getTBAAAccessInfo(QualType AccessType)
getTBAAAccessInfo - Get TBAA information that describes an access to an object of the given type.
Definition: CodeGenModule.cpp:1003
clang::CodeGen::CodeGenModule::DecorateInstructionWithTBAA
void DecorateInstructionWithTBAA(llvm::Instruction *Inst, TBAAAccessInfo TBAAInfo)
DecorateInstructionWithTBAA - Decorate the instruction with a TBAA tag.
Definition: CodeGenModule.cpp:1070
clang::CodeGen::CodeGenModule::EmitExternalDeclaration
void EmitExternalDeclaration(const VarDecl *D)
Definition: CodeGenModule.cpp:4665
clang::CodeGen::CodeGenModule::getNSConcreteStackBlock
llvm::Constant * getNSConcreteStackBlock()
Definition: CGBlocks.cpp:2895
clang::CodeGen::CGCalleeInfo
Abstract information about a function or function prototype.
Definition: CGCall.h:38
clang::ObjCRuntime
The basic abstraction for the target Objective-C runtime.
Definition: ObjCRuntime.h:28
clang::CodeGen::CodeGenModule::getNullPointer
llvm::Constant * getNullPointer(llvm::PointerType *T, QualType QT)
Get target specific null pointer.
Definition: CGExprConstant.cpp:1763
clang::CodeGen::CodeGenModule::IsOSVersionAtLeastFn
llvm::FunctionCallee IsOSVersionAtLeastFn
Definition: CodeGenModule.h:660
Priority
int Priority
Definition: Format.cpp:2776
clang::CodeGen::InstrProfStats::reportDiagnostics
void reportDiagnostics(DiagnosticsEngine &Diags, StringRef MainFile)
Report potential problems we've found to Diags.
Definition: CodeGenModule.cpp:451
clang::LangOptions
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:82
clang::CodeGen::CodeGenModule::GetAddrOfConstantStringFromLiteral
ConstantAddress GetAddrOfConstantStringFromLiteral(const StringLiteral *S, StringRef Name=".str")
Return a pointer to a constant array for the given string literal.
Definition: CodeGenModule.cpp:5905
clang::CodeGen::CodeGenModule::supportsCOMDAT
bool supportsCOMDAT() const
Definition: TargetInfo.cpp:12188
clang::ObjCPropertyAttribute::Kind
Kind
Definition: DeclObjCCommon.h:22
clang::CodeGen::CGFunctionInfo
CGFunctionInfo - Class to encapsulate the information about a function definition.
Definition: CGFunctionInfo.h:546
clang::CodeGen::CodeGenModule::NeedAllVtablesTypeId
bool NeedAllVtablesTypeId() const
Returns whether this module needs the "all-vtables" type identifier.
Definition: CodeGenModule.cpp:7006
clang::CodeGen::CodeGenModule::EmitAnnotateAttr
llvm::Constant * EmitAnnotateAttr(llvm::GlobalValue *GV, const AnnotateAttr *AA, SourceLocation L)
Generate the llvm::ConstantStruct which contains the annotation information for a given GlobalValue.
Definition: CodeGenModule.cpp:2912
clang::CodeGen::CodeGenModule::Structor::Structor
Structor(int Priority, unsigned LexOrder, llvm::Constant *Initializer, llvm::Constant *AssociatedData)
Definition: CodeGenModule.h:289
clang::CodeGen::ObjCEntrypoints::objc_unsafeClaimAutoreleasedReturnValue
llvm::Function * objc_unsafeClaimAutoreleasedReturnValue
id objc_unsafeClaimAutoreleasedReturnValue(id);
Definition: CodeGenModule.h:201
clang::CodeGen::CodeGenModule::GetVCallVisibilityLevel
llvm::GlobalObject::VCallVisibility GetVCallVisibilityLevel(const CXXRecordDecl *RD, llvm::DenseSet< const CXXRecordDecl * > &Visited)
Returns the vcall visibility of the given type.
Definition: CGVTables.cpp:1252
clang::CodeGen::ObjCEntrypoints
Definition: CodeGenModule.h:118
clang::CodeGen::CodeGenModule::getHeaderSearchOpts
const HeaderSearchOptions & getHeaderSearchOpts() const
Definition: CodeGenModule.h:734
clang::CodeGen::CodeGenModule::getPreprocessorOpts
const PreprocessorOptions & getPreprocessorOpts() const
Definition: CodeGenModule.h:736
clang::CodeGen::NotForDefinition
@ NotForDefinition
Definition: CodeGenModule.h:98
clang::VTableLayout
Definition: VTableBuilder.h:233
clang::CodeGen::CodeGenModule::getMemberPointerConstant
llvm::Constant * getMemberPointerConstant(const UnaryOperator *e)
Definition: CGExprConstant.cpp:2221
clang::CodeGen::CodeGenModule::getModuleNameHash
const std::string & getModuleNameHash() const
Definition: CodeGenModule.h:627
clang::CodeGen::BlockByrefHelpers::profileImpl
virtual void profileImpl(llvm::FoldingSetNodeID &id) const =0
clang
Definition: CalledOnceCheck.h:17
memset
__DEVICE__ void * memset(void *__a, int __b, size_t __c)
Definition: __clang_cuda_device_functions.h:1552
clang::CodeGen::ObjCEntrypoints::objc_moveWeak
llvm::Function * objc_moveWeak
void objc_moveWeak(id *dest, id *src);
Definition: CodeGenModule.h:166
XRayLists.h
clang::CodeGen::CodeGenModule::setStaticLocalDeclGuardAddress
void setStaticLocalDeclGuardAddress(const VarDecl *D, llvm::GlobalVariable *C)
Definition: CodeGenModule.h:686
clang::CodeGen::CodeGenModule::CtorList
std::vector< Structor > CtorList
Definition: CodeGenModule.h:299
clang::CodeGen::CodeGenModule::addCompilerUsedGlobal
void addCompilerUsedGlobal(llvm::GlobalValue *GV)
Add a global to a list to be added to the llvm.compiler.used metadata.
Definition: CodeGenModule.cpp:2521
clang::CodeGen::CodeGenModule::getVTableLinkage
llvm::GlobalVariable::LinkageTypes getVTableLinkage(const CXXRecordDecl *RD)
Return the appropriate linkage for the vtable, VTT, and type information of the given class.
Definition: CGVTables.cpp:1031
clang::CodeGen::ObjCEntrypoints::ObjCEntrypoints
ObjCEntrypoints()
Definition: CodeGenModule.h:119
clang::CodeGen::CodeGenModule::addReplacement
void addReplacement(StringRef Name, llvm::Constant *C)
Definition: CodeGenModule.cpp:269
clang::CodeGen::CodeGenModule::GetAddrOfConstantCString
ConstantAddress GetAddrOfConstantCString(const std::string &Str, const char *GlobalName=nullptr)
Returns a pointer to a character array containing the literal and a terminating '\0' character.
Definition: CodeGenModule.cpp:5967
clang::Stmt
Stmt - This represents one statement.
Definition: Stmt.h:72
clang::CodeGen::CodeGenModule::TryEmitBaseDestructorAsAlias
bool TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D)
Try to emit a base destructor as an alias to its primary base-class destructor.
Definition: CGCXX.cpp:34
clang::CodeGen::CodeGenModule::getOMPAllocateAlignment
std::optional< CharUnits > getOMPAllocateAlignment(const VarDecl *VD)
Return the alignment specified in an allocate directive, if present.
Definition: CGDecl.cpp:2703
clang::CodeGen::ObjCEntrypoints::objc_alloc
llvm::FunctionCallee objc_alloc
void objc_alloc(id);
Definition: CodeGenModule.h:122
clang::CodeGen::CodeGenModule::GetLLVMVisibility
static llvm::GlobalValue::VisibilityTypes GetLLVMVisibility(Visibility V)
Definition: CodeGenModule.h:864
clang::DefaultVisibility
@ DefaultVisibility
Objects with "default" visibility are seen by the dynamic linker and act like normal objects.
Definition: Visibility.h:45
clang::CodeGen::CodeGenModule::getLLVMLifetimeEndFn
llvm::Function * getLLVMLifetimeEndFn()
Lazily declare the @llvm.lifetime.end intrinsic.
Definition: CGDecl.cpp:2418
clang::CodeGen::ObjCEntrypoints::objc_retainBlock
llvm::Function * objc_retainBlock
id objc_retainBlock(id);
Definition: CodeGenModule.h:185
clang::CodeGen::CodeGenModule::getNaturalTypeAlignment
CharUnits getNaturalTypeAlignment(QualType T, LValueBaseInfo *BaseInfo=nullptr, TBAAAccessInfo *TBAAInfo=nullptr, bool forPointeeType=false)
Definition: CodeGenModule.cpp:7061
clang::CodeGen::ObjCEntrypoints::objc_loadWeakRetained
llvm::Function * objc_loadWeakRetained
id objc_loadWeakRetained(id*);
Definition: CodeGenModule.h:163
clang::CodeGen::CodeGenModule::getUniqueBlockCount
int getUniqueBlockCount()
Fetches the global unique block count.
Definition: CodeGenModule.h:993
clang::Attr
Attr - This represents one attribute.
Definition: Attr.h:40
clang::CodeGen::CodeGenModule::getPGOStats
InstrProfStats & getPGOStats()
Definition: CodeGenModule.h:664
clang::OMPRequiresDecl
This represents '#pragma omp requires...' directive.
Definition: DeclOpenMP.h:416
clang::CodeGen::ObjCEntrypoints::objc_autoreleaseRuntimeFunction
llvm::FunctionCallee objc_autoreleaseRuntimeFunction
id objc_autorelease(id); Note this is the runtime method not the intrinsic.
Definition: CodeGenModule.h:145
clang::CodeGen::TBAAAccessInfo::getMayAliasInfo
static TBAAAccessInfo getMayAliasInfo()
Definition: CodeGenTBAA.h:62
clang::CodeGen::CodeGenModule::getDiags
DiagnosticsEngine & getDiags() const
Definition: CodeGenModule.h:740
clang::CodeGen::CodeGenModule::GetWeakRefReference
ConstantAddress GetWeakRefReference(const ValueDecl *VD)
Get a reference to the target of VD.
Definition: CodeGenModule.cpp:3236
clang::CodeGen::OrderGlobalInitsOrStermFinalizers::priority
unsigned int priority
Definition: CodeGenModule.h:103
clang::CodeGen::CodeGenModule::getNoObjCARCExceptionsMetadata
llvm::MDNode * getNoObjCARCExceptionsMetadata()
Definition: CodeGenModule.h:722
clang::CodeGen::CodeGenModule::mergeTBAAInfoForConditionalOperator
TBAAAccessInfo mergeTBAAInfoForConditionalOperator(TBAAAccessInfo InfoA, TBAAAccessInfo InfoB)
mergeTBAAInfoForConditionalOperator - Get merged TBAA information for the purposes of conditional ope...
Definition: CodeGenModule.cpp:1055
clang::CodeGen::CodeGenModule::AddDetectMismatch
void AddDetectMismatch(StringRef Name, StringRef Value)
Appends a detect mismatch command to the linker options.
Definition: CodeGenModule.cpp:2572
clang::CodeGen::CodeGenModule::getLLVMLinkageVarDefinition
llvm::GlobalValue::LinkageTypes getLLVMLinkageVarDefinition(const VarDecl *VD, bool IsConstant)
Returns LLVM linkage for a declarator.
Definition: CodeGenModule.cpp:5233
clang::CodeGen::CodeGenVTables
Definition: CGVTables.h:32
clang::GlobalDecl::getDecl
const Decl * getDecl() const
Definition: GlobalDecl.h:103
GlobalDecl.h
clang::CodeGen::CodeGenModule::getCUDARuntime
CGCUDARuntime & getCUDARuntime()
Return a reference to the configured CUDA runtime.
Definition: CodeGenModule.h:642
clang::CodeGen::CodeGenModule::UpdateCompletedType
void UpdateCompletedType(const TagDecl *TD)
Definition: CodeGenModule.cpp:987
clang::CodeGen::CodeGenModule::getBlockMangledName
StringRef getBlockMangledName(GlobalDecl GD, const BlockDecl *BD)
Definition: CodeGenModule.cpp:1597
clang::CodeGen::CodeGenModule::EmitAnnotationString
llvm::Constant * EmitAnnotationString(StringRef Str)
Emit an annotation string.
Definition: CodeGenModule.cpp:2846
clang::CodeGen::CodeGenModule::getFunctionLinkage
llvm::GlobalVariable::LinkageTypes getFunctionLinkage(GlobalDecl GD)
Definition: CodeGenModule.cpp:1694
clang::CodeGen::CGCXXABI
Implements C++ ABI-specific code generation functions.
Definition: CGCXXABI.h:43
clang::CharUnits
CharUnits - This is an opaque type for sizes expressed in character units.
Definition: CharUnits.h:38
Mangle.h
clang::CodeGen::CodeGenModule::GetAddrOfConstantStringFromObjCEncode
ConstantAddress GetAddrOfConstantStringFromObjCEncode(const ObjCEncodeExpr *)
Return a pointer to a constant array for the given ObjCEncodeExpr node.
Definition: CodeGenModule.cpp:5957
clang::index::SymbolKind::Function
@ Function
clang::CodeGen::CodeGenModule::setGVPropertiesAux
void setGVPropertiesAux(llvm::GlobalValue *GV, const NamedDecl *D) const
Definition: CodeGenModule.cpp:1282
clang::CodeGen::CodeGenModule::GetAddrOfThunk
llvm::Constant * GetAddrOfThunk(StringRef Name, llvm::Type *FnTy, GlobalDecl GD)
Get the address of the thunk for the given global decl.
Definition: CGVTables.cpp:34
clang::AtomicType
Definition: Type.h:6451
clang::CodeGen::CodeGenModule::Structor::LexOrder
unsigned LexOrder
Definition: CodeGenModule.h:294
CGVTables.h
PreprocessorOptions.h
clang::Expr
This represents one expression.
Definition: Expr.h:110
clang::CodeGen::CodeGenVTables::getItaniumVTableContext
ItaniumVTableContext & getItaniumVTableContext()
Definition: CGVTables.h:101
clang::CodeGen::CodeGenModule::getAddrOfCXXStructor
llvm::Constant * getAddrOfCXXStructor(GlobalDecl GD, const CGFunctionInfo *FnInfo=nullptr, llvm::FunctionType *FnType=nullptr, bool DontDefer=false, ForDefinition_t IsForDefinition=NotForDefinition)
Return the address of the constructor/destructor of the given type.
Definition: CodeGenModule.h:1073
clang::CodeGen::CodeGenModule::setGVProperties
void setGVProperties(llvm::GlobalValue *GV, GlobalDecl GD) const
Set visibility, dllimport/dllexport and dso_local.
Definition: CodeGenModule.cpp:1270
clang::CodeGen::CodeGenModule::GetAddrOfUnnamedGlobalConstantDecl
ConstantAddress GetAddrOfUnnamedGlobalConstantDecl(const UnnamedGlobalConstantDecl *GCD)
Get the address of a UnnamedGlobalConstant.
Definition: CodeGenModule.cpp:3178
clang::CodeGen::CodeGenModule::getLLVMLifetimeStartFn
llvm::Function * getLLVMLifetimeStartFn()
Lazily declare the @llvm.lifetime.start intrinsic.
Definition: CGDecl.cpp:2409
clang::transformer::name
RangeSelector name(std::string ID)
Given a node with a "name", (like NamedDecl, DeclRefExpr, CxxCtorInitializer, and TypeLoc) selects th...
Definition: RangeSelector.cpp:200
clang::CodeGen::CodeGenModule::getObjCEntrypoints
ObjCEntrypoints & getObjCEntrypoints() const
Definition: CodeGenModule.h:653
clang::CodeGen::CodeGenModule::AddVTableTypeMetadata
void AddVTableTypeMetadata(llvm::GlobalVariable *VTable, CharUnits Offset, const CXXRecordDecl *RD)
Create and attach type metadata for the given vtable.
Definition: CodeGenModule.cpp:7019
clang::CodeGen::CodeGenModule::DecorateInstructionWithInvariantGroup
void DecorateInstructionWithInvariantGroup(llvm::Instruction *I, const CXXRecordDecl *RD)
Adds !invariant.barrier !tag to instruction.
Definition: CodeGenModule.cpp:1076
clang::CodeGen::BlockByrefHelpers::CopyHelper
llvm::Constant * CopyHelper
Definition: CodeGenModule.h:252
clang::FunctionDecl
Represents a function declaration or definition.
Definition: Decl.h:1917
clang::CodeGen::BlockByrefHelpers::emitDispose
virtual void emitDispose(CodeGenFunction &CGF, Address field)=0
clang::CodeGen::CodeGenModule::setTLSMode
void setTLSMode(llvm::GlobalValue *GV, const VarDecl &D) const
Set the TLS mode for the given LLVM GlobalValue for the thread-local variable declaration D.
Definition: CodeGenModule.cpp:1312
clang::CodeGen::CodeGenModule::AddCXXDtorEntry
void AddCXXDtorEntry(llvm::FunctionCallee DtorFn, llvm::Constant *Object)
Add a destructor and object to add to the C++ global destructor function.
Definition: CodeGenModule.h:1133
clang::CodeGen::CodeGenModule::GetAddrOfGlobalTemporary
ConstantAddress GetAddrOfGlobalTemporary(const MaterializeTemporaryExpr *E, const Expr *Inner)
Returns a pointer to a global variable representing a temporary with static or thread storage duratio...
Definition: CodeGenModule.cpp:6001
clang::CodeGen::CodeGenModule::addGlobalValReplacement
void addGlobalValReplacement(llvm::GlobalValue *GV, llvm::Constant *C)
Definition: CodeGenModule.cpp:304
clang::CodeGen::CodeGenModule::getAddrOfConstantCompoundLiteralIfEmitted
llvm::GlobalVariable * getAddrOfConstantCompoundLiteralIfEmitted(const CompoundLiteralExpr *E)
If it's been emitted already, returns the GlobalVariable corresponding to a compound literal.
Definition: CGExprConstant.cpp:2201
clang::CodeGen::CodeGenModule::getSanitizerMetadata
SanitizerMetadata * getSanitizerMetadata()
Definition: CodeGenModule.h:1378
clang::CodeGen::CodeGenModule::moveLazyEmissionStates
void moveLazyEmissionStates(CodeGenModule *NewBuilder)
Move some lazily-emitted states to the NewBuilder.
Definition: CodeGenModule.cpp:7190
clang::CodeGen::CodeGenModule::Structor::AssociatedData
llvm::Constant * AssociatedData
Definition: CodeGenModule.h:296
clang::CodeGen::CodeGenModule::EmitAnnotationLineNo
llvm::Constant * EmitAnnotationLineNo(SourceLocation L)
Emit the annotation line number.
Definition: CodeGenModule.cpp:2871
clang::CodeGen::CodeGenModule::hasObjCRuntime
bool hasObjCRuntime()
Return true iff an Objective-C runtime has been configured.
Definition: CodeGenModule.h:625
clang::CodeGen::ObjCEntrypoints::objc_storeWeak
llvm::Function * objc_storeWeak
id objc_storeWeak(id*, id);
Definition: CodeGenModule.h:198
clang::CodeGen::CodeGenModule::Error
void Error(SourceLocation loc, StringRef error)
Emit a general error that something can't be done.
Definition: CodeGenModule.cpp:1082
clang::CodeGen::CodeGenModule::getLLVMContext
llvm::LLVMContext & getLLVMContext()
Definition: CodeGenModule.h:750
clang::CharUnits::getQuantity
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
Definition: CharUnits.h:185
clang::SanitizerMask
Definition: Sanitizers.h:30
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem >
clang::UnnamedGlobalConstantDecl
An artificial decl, representing a global anonymous constant value which is uniquified by value withi...
Definition: DeclCXX.h:4257
clang::CodeGen::CodeGenModule::mergeTBAAInfoForMemoryTransfer
TBAAAccessInfo mergeTBAAInfoForMemoryTransfer(TBAAAccessInfo DestInfo, TBAAAccessInfo SrcInfo)
mergeTBAAInfoForMemoryTransfer - Get merged TBAA information for the purposes of memory transfer call...
Definition: CodeGenModule.cpp:1063
clang::CodeGen::CodeGenModule::EmitOMPRequiresDecl
void EmitOMPRequiresDecl(const OMPRequiresDecl *D)
Emit a code for requires directive.
Definition: CGDecl.cpp:2644
clang::ExplicitCastExpr
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3704
clang::CodeGen::CodeGenModule::SetCommonAttributes
void SetCommonAttributes(GlobalDecl GD, llvm::GlobalValue *GV)
Set attributes which are common to any form of a global definition (alias, Objective-C method,...
Definition: CodeGenModule.cpp:2174
clang::CodeGen::CodeGenModule::EmitNullConstantForBase
llvm::Constant * EmitNullConstantForBase(const CXXRecordDecl *Record)
Return a null constant appropriate for zero-initializing a base class with the given type.
Definition: CGExprConstant.cpp:2374
clang::HeaderSearchOptions
HeaderSearchOptions - Helper class for storing options related to the initialization of the HeaderSea...
Definition: HeaderSearchOptions.h:68
clang::CodeGen::CGObjCRuntime
Implements runtime-specific code generation functions.
Definition: CGObjCRuntime.h:65
clang::CodeGen::CodeGenModule::getTypeDescriptorFromMap
llvm::Constant * getTypeDescriptorFromMap(QualType Ty)
Definition: CodeGenModule.h:713
clang::CodeGen::CodeGenModule::isInNoSanitizeList
bool isInNoSanitizeList(SanitizerMask Kind, llvm::Function *Fn, SourceLocation Loc) const
Definition: CodeGenModule.cpp:2948
clang::CodeGen::CodeGenModule::getTBAAStructInfo
llvm::MDNode * getTBAAStructInfo(QualType QTy)
Definition: CodeGenModule.cpp:1029
clang::CodeGen::CodeGenModule::getTBAATypeInfo
llvm::MDNode * getTBAATypeInfo(QualType QTy)
getTBAATypeInfo - Get metadata used to describe accesses to objects of the given type.
Definition: CodeGenModule.cpp:997
clang::CodeGen::CodeGenModule::getExpressionLocationsEnabled
bool getExpressionLocationsEnabled() const
Return true if we should emit location information for expressions.
Definition: CodeGenModule.cpp:5802