aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorAlexandros Lamprineas <alexandros.lamprineas@arm.com>2024-03-20 09:24:29 +0000
committerGitHub <noreply@github.com>2024-03-20 09:24:29 +0000
commite6b5bd5854c80eac05f415ad282ba84b840b8af8 (patch)
treedf45a227f0b2878c637dc809fde435b92dd83724 /clang/lib/CodeGen/CodeGenModule.h
parent070d1e83213f0e9eb71582141dd2323131a307e3 (diff)
downloadllvm-e6b5bd5854c80eac05f415ad282ba84b840b8af8.zip
llvm-e6b5bd5854c80eac05f415ad282ba84b840b8af8.tar.gz
llvm-e6b5bd5854c80eac05f415ad282ba84b840b8af8.tar.bz2
[FMV] Emit the resolver along with the default version definition. (#84405)
We would like the resolver to be generated eagerly, even if the versioned function is not called from the current translation unit. Fixes #81494. It further allows Multi Versioning to work even if the default target version attribute is omitted from function declarations.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index ec34680f..1cc4477 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -348,6 +348,8 @@ private:
/// yet.
llvm::DenseMap<StringRef, GlobalDecl> DeferredDecls;
+ llvm::StringSet<llvm::BumpPtrAllocator> DeferredResolversToEmit;
+
/// This is a list of deferred decls which we have seen that *are* actually
/// referenced. These get code generated when the module is done.
std::vector<GlobalDecl> DeferredDeclsToEmit;
@@ -1588,6 +1590,9 @@ private:
llvm::AttributeList ExtraAttrs = llvm::AttributeList(),
ForDefinition_t IsForDefinition = NotForDefinition);
+ // Adds a declaration to the list of multi version functions if not present.
+ void AddDeferredMultiVersionResolverToEmit(GlobalDecl GD);
+
// References to multiversion functions are resolved through an implicitly
// defined resolver function. This function is responsible for creating
// the resolver symbol for the provided declaration. The value returned