We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d43ec97 commit c942cb2Copy full SHA for c942cb2
clang/lib/Driver/ToolChains/Arch/AArch64.cpp
@@ -445,4 +445,21 @@ void aarch64::getAArch64TargetFeatures(const Driver &D,
445
446
if (Args.getLastArg(options::OPT_mno_bti_at_return_twice))
447
Features.push_back("+no-bti-at-return-twice");
448
+
449
+ // Parse AArch64 CPU Features
450
+ const Arg *CPUArg = Args.getLastArg(options::OPT_mcpu_EQ);
451
+ StringRef CPUName;
452
453
+ if (CPUArg) {
454
+ CPUName = CPUArg->getValue();
455
+ if (CPUName == "native") {
456
+ llvm::StringMap<bool> HostFeatures;
457
+ if (llvm::sys::getHostCPUFeatures(HostFeatures)) {
458
+ for (auto &F : HostFeatures) {
459
+ Features.push_back(
460
+ Args.MakeArgString((F.second ? "+" : "-") + F.first()));
461
+ }
462
463
464
465
}
0 commit comments