diff options
author | dim <dim@FreeBSD.org> | 2014-02-26 22:18:33 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-02-26 22:18:33 +0000 |
commit | cf2831323c5785649925d1d55a4ba9935a8f5d15 (patch) | |
tree | 62ea7cca2e7dbb49fcaef3bc56512884ee069870 /contrib/llvm | |
parent | b6b1de44bac83664c1e0c7328bbaf6a9916d1e81 (diff) | |
download | FreeBSD-src-cf2831323c5785649925d1d55a4ba9935a8f5d15.zip FreeBSD-src-cf2831323c5785649925d1d55a4ba9935a8f5d15.tar.gz |
Pull in r202177 from upstream clang trunk (by Roman Divacky):
Give sparcv9 the ability to set the target cpu. Change it from
accepting -march which doesnt exist on sparc gcc to -mcpu. While here
adjust a few tests to not write an unused temporary file.
Diffstat (limited to 'contrib/llvm')
-rw-r--r-- | contrib/llvm/tools/clang/lib/Basic/Targets.cpp | 16 | ||||
-rw-r--r-- | contrib/llvm/tools/clang/lib/Driver/Tools.cpp | 3 |
2 files changed, 18 insertions, 1 deletions
diff --git a/contrib/llvm/tools/clang/lib/Basic/Targets.cpp b/contrib/llvm/tools/clang/lib/Basic/Targets.cpp index 70b7ac5..af9221b 100644 --- a/contrib/llvm/tools/clang/lib/Basic/Targets.cpp +++ b/contrib/llvm/tools/clang/lib/Basic/Targets.cpp @@ -4552,6 +4552,22 @@ public: Builder.defineMacro("__sparcv9__"); } } + + virtual bool setCPU(const std::string &Name) { + bool CPUKnown = llvm::StringSwitch<bool>(Name) + .Case("v9", true) + .Case("ultrasparc", true) + .Case("ultrasparc3", true) + .Case("niagara", true) + .Case("niagara2", true) + .Case("niagara3", true) + .Case("niagara4", true) + .Default(false); + + // No need to store the CPU yet. There aren't any CPU-specific + // macros to define. + return CPUKnown; + } }; } // end anonymous namespace. diff --git a/contrib/llvm/tools/clang/lib/Driver/Tools.cpp b/contrib/llvm/tools/clang/lib/Driver/Tools.cpp index fe62a03..2b85eb6 100644 --- a/contrib/llvm/tools/clang/lib/Driver/Tools.cpp +++ b/contrib/llvm/tools/clang/lib/Driver/Tools.cpp @@ -1373,7 +1373,8 @@ static std::string getCPUName(const ArgList &Args, const llvm::Triple &T) { } case llvm::Triple::sparc: - if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) + case llvm::Triple::sparcv9: + if (const Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) return A->getValue(); return ""; |