[Driver] Set the '-target-cpu' for non-64 arm as well.

Depends on clang r212666.
Fixes rdar://17603166

Swift SVN r19774
This commit is contained in:
Argyrios Kyrtzidis
2014-07-10 01:29:47 +00:00
parent b84a3377f0
commit 8dba1a0b7e
2 changed files with 16 additions and 0 deletions

View File

@@ -21,6 +21,7 @@
#include "swift/Driver/Job.h"
#include "swift/Driver/Options.h"
#include "swift/Frontend/Frontend.h"
#include "clang/Driver/Util.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
@@ -80,6 +81,12 @@ static void configureDefaultCPU(const llvm::Triple &triple,
args.push_back("cyclone");
args.push_back("-target-feature");
args.push_back("+neon");
} else if (triple.getArch() == llvm::Triple::arm) {
if (auto CPUStr = clang::driver::getARMCPUForMArch(triple.getArchName(),
triple)) {
args.push_back("-target-cpu");
args.push_back(CPUStr);
}
}
}