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