1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

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.
This commit is contained in:
Dimitry Andric 2014-02-26 22:18:33 +00:00
parent c3bb517174
commit d7538a4458
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/clang-sparc64/; revision=262535
2 changed files with 18 additions and 1 deletions

View File

@ -4552,6 +4552,22 @@ class SparcV9TargetInfo : public SparcTargetInfo {
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.

View File

@ -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 "";