From 9b1586b6cc53069b109d1cd85da7bcd49b481a9e Mon Sep 17 00:00:00 2001 From: James Molloy Date: Thu, 17 Apr 2014 12:51:17 +0000 Subject: [ARM64] Default to the 'generic' CPU, unless -arch is present for backwards compatibility. llvm-svn: 206461 --- clang/lib/Driver/Tools.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'clang/lib/Driver/Tools.cpp') diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 9f64c3fa461..a0ab03278da 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -875,8 +875,12 @@ static std::string getARM64TargetCPU(const ArgList &Args) { // 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, -- cgit v1.2.3