From cf2831323c5785649925d1d55a4ba9935a8f5d15 Mon Sep 17 00:00:00 2001 From: dim Date: Wed, 26 Feb 2014 22:18:33 +0000 Subject: 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. --- contrib/llvm/tools/clang/lib/Basic/Targets.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'contrib/llvm/tools/clang/lib/Basic/Targets.cpp') 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(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. -- cgit v1.1