[clang] [FMV] Emit the resolver along with the default version definition. (PR #84405)

Jon Roelofs via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 15 09:19:55 PDT 2024


================
@@ -4347,6 +4362,19 @@ void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) {
   }
 }
 
+/// Adds a declaration to the list of multi version functions if not present.
+void CodeGenModule::AddDeferredMultiVersionResolverToEmit(GlobalDecl GD) {
+  const auto *FD = cast<FunctionDecl>(GD.getDecl());
+  assert(FD && "Not a FunctionDecl?");
+
+  if (FD->isTargetVersionMultiVersion()) {
+    StringRef NamePrefix = getMangledName(GD).split('.').first;
----------------
jroelofs wrote:

Hm. Is there somewhere convenient to stick an `llvm::StringSaver`?

https://github.com/llvm/llvm-project/pull/84405


More information about the cfe-commits mailing list