[clang] [clang][FMV] Do not omit explicit default target_version attribute. (PR #96628)

Alexandros Lamprineas via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 25 05:49:31 PDT 2024


labrinea wrote:

Alternative one liner:
```
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index dd4a665ebc78..0c96a6de091a 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -3763,7 +3763,7 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) {
     // Forward declarations are emitted lazily on first use.
     if (!FD->doesThisDeclarationHaveABody()) {
       if (!FD->doesDeclarationForceExternallyVisibleDefinition() &&
-          (!FD->isMultiVersion() ||
+          (FD->getMultiVersionKind() == MultiVersionKind::None ||
            !FD->getASTContext().getTargetInfo().getTriple().isAArch64()))
         return;
```
but I believe not emitting the explicit default and then patching it later is a hack.

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


More information about the cfe-commits mailing list