Index: lib/Basic/Targets.cpp |
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp |
index 6469c465747261f62bba450222d560a46013644a..3f0e26ec6093e9ce452ae5be2a9ef0c4ddc1ad44 100644 |
--- a/lib/Basic/Targets.cpp |
+++ b/lib/Basic/Targets.cpp |
@@ -1549,9 +1549,10 @@ public: |
virtual bool hasFeature(StringRef Feature) const; |
virtual void HandleTargetFeatures(std::vector<std::string> &Features); |
virtual const char* getABI() const { |
- if (PointerWidth == 64 && SSELevel >= AVX) |
+ if (getTriple().getArch() == llvm::Triple::x86_64 && SSELevel >= AVX) |
return "avx"; |
- else if (PointerWidth == 32 && MMX3DNowLevel == NoMMX3DNow) |
+ else if (getTriple().getArch() == llvm::Triple::x86 && |
+ MMX3DNowLevel == NoMMX3DNow) |
return "no-mmx"; |
return ""; |
} |
@@ -1645,7 +1646,7 @@ public: |
case CK_AthlonMP: |
case CK_Geode: |
// Only accept certain architectures when compiling in 32-bit mode. |
- if (PointerWidth != 32) |
+ if (getTriple().getArch() != llvm::Triple::x86) |
return false; |
// Fallthrough |
@@ -1716,7 +1717,7 @@ void X86TargetInfo::getDefaultFeatures(llvm::StringMap<bool> &Features) const { |
// FIXME: This *really* should not be here. |
// X86_64 always has SSE2. |
- if (PointerWidth == 64) |
+ if (getTriple().getArch() == llvm::Triple::x86_64) |
Features["sse2"] = Features["sse"] = Features["mmx"] = true; |
switch (CPU) { |
@@ -2089,7 +2090,7 @@ void X86TargetInfo::HandleTargetFeatures(std::vector<std::string> &Features) { |
void X86TargetInfo::getTargetDefines(const LangOptions &Opts, |
MacroBuilder &Builder) const { |
// Target identification. |
- if (PointerWidth == 64) { |
+ if (getTriple().getArch() == llvm::Triple::x86_64) { |
Builder.defineMacro("__amd64__"); |
Builder.defineMacro("__amd64"); |
Builder.defineMacro("__x86_64"); |
@@ -2285,7 +2286,7 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts, |
break; |
} |
- if (Opts.MicrosoftExt && PointerWidth == 32) { |
+ if (Opts.MicrosoftExt && getTriple().getArch() == llvm::Triple::x86) { |
switch (SSELevel) { |
case AVX2: |
case AVX: |
@@ -2341,8 +2342,8 @@ bool X86TargetInfo::hasFeature(StringRef Feature) const { |
.Case("sse42", SSELevel >= SSE42) |
.Case("sse4a", HasSSE4a) |
.Case("x86", true) |
- .Case("x86_32", PointerWidth == 32) |
- .Case("x86_64", PointerWidth == 64) |
+ .Case("x86_32", getTriple().getArch() == llvm::Triple::x86) |
+ .Case("x86_64", getTriple().getArch() == llvm::Triple::x86_64) |
.Case("xop", HasXOP) |
.Default(false); |
} |