From 4b4fe385e49bd883fd183b5f21c1ea486c722e61 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 24 Jul 2022 17:03:44 +0200 Subject: Vendor import of llvm-project main llvmorg-15-init-17485-ga3e38b4a206b. --- clang/lib/CodeGen/CodeGenModule.h | 49 ++++++++++++++------------------------- 1 file changed, 17 insertions(+), 32 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.h') diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 10b49da27dab..c939e7a309f5 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -303,7 +303,7 @@ private: std::unique_ptr ABI; llvm::LLVMContext &VMContext; std::string ModuleNameHash; - + bool CXX20ModuleInits = false; std::unique_ptr TBAA; mutable std::unique_ptr 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(); -- cgit v1.2.3