[ARM64] Default to the 'generic' CPU, unless -arch is present for backwards compatibility.
llvm-svn: 206461
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 9f64c3f..a0ab032 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -875,8 +875,12 @@
// At some point, we may need to check -march here, but for now we only
// one arm64 architecture.
- // Default to "cyclone" CPU.
- return "cyclone";
+ // Make sure we pick "cyclone" if -arch is used.
+ // FIXME: Should this be picked by checking the target triple instead?
+ if (Args.getLastArg(options::OPT_arch))
+ return "cyclone";
+
+ return "generic";
}
void Clang::AddARM64TargetArgs(const ArgList &Args,