Add more support for xBSD type OS.

Use the same code for FreeBSD, NetBSD, OpenBSD and DragonFly BSD.
This commit is contained in:
Kai Nacke 2016-01-19 22:04:14 +01:00
parent f94c34ea33
commit 8df1f7ec1a
4 changed files with 34 additions and 7 deletions

View file

@ -125,9 +125,8 @@ static std::string getX86TargetCPU(const llvm::Triple &triple) {
// Intel Macs are relatively recent, take advantage of that.
if (triple.isOSDarwin()) {
return triple.isArch64Bit() ? "core2" : "yonah";
// Everything else goes to x86-64 in 64-bit mode.
}
// Everything else goes to x86-64 in 64-bit mode.
if (triple.isArch64Bit()) {
return "x86-64";
}
@ -145,9 +144,15 @@ static std::string getX86TargetCPU(const llvm::Triple &triple) {
}
if (triple.getOSName().startswith("netbsd")) {
return "i486";
// All x86 devices running Android have core2 as their common
// denominator. This makes a better choice than pentium4.
}
if (triple.getOSName().startswith("openbsd")) {
return "i486";
}
if (triple.getOSName().startswith("dragonfly")) {
return "i486";
}
// All x86 devices running Android have core2 as their common
// denominator. This makes a better choice than pentium4.
if (triple.getEnvironment() == llvm::Triple::Android) {
return "core2";