aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index c49f763..5f15f0f 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -2748,7 +2748,21 @@ bool CodeGenModule::GetCPUAndFeaturesAttributes(GlobalDecl GD,
Attrs.addAttribute("target-features", llvm::join(Features, ","));
AddedAttr = true;
}
-
+ if (getTarget().getTriple().isAArch64()) {
+ llvm::SmallVector<StringRef, 8> Feats;
+ if (TV)
+ TV->getFeatures(Feats);
+ else if (TC)
+ TC->getFeatures(Feats, GD.getMultiVersionIndex());
+ if (!Feats.empty()) {
+ llvm::sort(Feats);
+ std::string FMVFeatures;
+ for (StringRef F : Feats)
+ FMVFeatures.append(",+" + F.str());
+ Attrs.addAttribute("fmv-features", FMVFeatures.substr(1));
+ AddedAttr = true;
+ }
+ }
return AddedAttr;
}