aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-24 15:11:41 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-04-09 14:54:47 +0000
commit13a2180118bde2302097a9e6cc995c1b255724bb (patch)
treedc8fd473a84f667b02c5643765e99b9e5ad022fb /contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h
parent7982d1ea2c5eb2ea2261fd82ebd7eebdda0e58b3 (diff)
Diffstat (limited to 'contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h49
1 files changed, 17 insertions, 32 deletions
diff --git a/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h b/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h
index 10b49da27dab..c939e7a309f5 100644
--- a/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h
+++ b/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.h
@@ -303,7 +303,7 @@ private:
std::unique_ptr<CGCXXABI> ABI;
llvm::LLVMContext &VMContext;
std::string ModuleNameHash;
-
+ bool CXX20ModuleInits = false;
std::unique_ptr<CodeGenTBAA> TBAA;
mutable std::unique_ptr<TargetCodeGenInfo> TheTargetCodeGenInfo;
@@ -1340,9 +1340,15 @@ public:
bool imbueXRayAttrs(llvm::Function *Fn, SourceLocation Loc,
StringRef Category = StringRef()) const;
- /// Returns true if function at the given location should be excluded from
- /// profile instrumentation.
- bool isProfileInstrExcluded(llvm::Function *Fn, SourceLocation Loc) const;
+ /// \returns true if \p Fn at \p Loc should be excluded from profile
+ /// instrumentation by the SCL passed by \p -fprofile-list.
+ bool isFunctionBlockedByProfileList(llvm::Function *Fn,
+ SourceLocation Loc) const;
+
+ /// \returns true if \p Fn at \p Loc should be excluded from profile
+ /// instrumentation.
+ bool isFunctionBlockedFromProfileInstr(llvm::Function *Fn,
+ SourceLocation Loc) const;
SanitizerMetadata *getSanitizerMetadata() {
return SanitizerMD.get();
@@ -1508,34 +1514,7 @@ public:
/// Move some lazily-emitted states to the NewBuilder. This is especially
/// essential for the incremental parsing environment like Clang Interpreter,
/// because we'll lose all important information after each repl.
- void moveLazyEmissionStates(CodeGenModule *NewBuilder) {
- assert(DeferredDeclsToEmit.empty() &&
- "Should have emitted all decls deferred to emit.");
- assert(NewBuilder->DeferredDecls.empty() &&
- "Newly created module should not have deferred decls");
- NewBuilder->DeferredDecls = std::move(DeferredDecls);
-
- assert(NewBuilder->DeferredVTables.empty() &&
- "Newly created module should not have deferred vtables");
- NewBuilder->DeferredVTables = std::move(DeferredVTables);
-
- assert(NewBuilder->MangledDeclNames.empty() &&
- "Newly created module should not have mangled decl names");
- assert(NewBuilder->Manglings.empty() &&
- "Newly created module should not have manglings");
- NewBuilder->Manglings = std::move(Manglings);
-
- assert(WeakRefReferences.empty() &&
- "Not all WeakRefRefs have been applied");
- NewBuilder->WeakRefReferences = std::move(WeakRefReferences);
-
- NewBuilder->TBAA = std::move(TBAA);
-
- assert(NewBuilder->EmittedDeferredDecls.empty() &&
- "Still have (unmerged) EmittedDeferredDecls deferred decls");
-
- NewBuilder->EmittedDeferredDecls = std::move(EmittedDeferredDecls);
- }
+ void moveLazyEmissionStates(CodeGenModule *NewBuilder);
private:
llvm::Constant *GetOrCreateLLVMFunction(
@@ -1593,6 +1572,9 @@ private:
/// Emit the function that initializes C++ thread_local variables.
void EmitCXXThreadLocalInitFunc();
+ /// Emit the function that initializes global variables for a C++ Module.
+ void EmitCXXModuleInitFunc(clang::Module *Primary);
+
/// Emit the function that initializes C++ globals.
void EmitCXXGlobalInitFunc();
@@ -1660,6 +1642,9 @@ private:
/// Emit the llvm.used and llvm.compiler.used metadata.
void emitLLVMUsed();
+ /// For C++20 Itanium ABI, emit the initializers for the module.
+ void EmitModuleInitializers(clang::Module *Primary);
+
/// Emit the link options introduced by imported modules.
void EmitModuleLinkOptions();