]> granicus.if.org Git - clang/commitdiff
Use getArch instead of getArchName.
authorRafael Espindola <rafael.espindola@gmail.com>
Sun, 7 Oct 2012 03:23:40 +0000 (03:23 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sun, 7 Oct 2012 03:23:40 +0000 (03:23 +0000)
The darwin change should be a nop since Triple::getArchTypeForDarwinArchName
doesn't know about amd64.

If things like amd64-mingw32 are to be rejected, we should print a error
earlier on instead of silently using the wrong abi.

Remove old comment that looks out of place, this is "in clang".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165368 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp
lib/Driver/WindowsToolChain.cpp
test/Driver/clang-translation.c

index 27375de27d07544cfef6b24425e5a2a4a57b6ea1..54f8c4229465782c5d030fc839d96475fd50a1a7 100644 (file)
@@ -955,9 +955,7 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args,
 }
 
 bool Darwin::IsUnwindTablesDefault() const {
-  // FIXME: Gross; we should probably have some separate target
-  // definition, possibly even reusing the one in clang.
-  return getArchName() == "x86_64";
+  return getArch() == llvm::Triple::x86_64;
 }
 
 bool Darwin::UseDwarfDebugFlags() const {
@@ -1457,8 +1455,6 @@ Tool &Generic_GCC::SelectTool(const Compilation &C,
 }
 
 bool Generic_GCC::IsUnwindTablesDefault() const {
-  // FIXME: Gross; we should probably have some separate target
-  // definition, possibly even reusing the one in clang.
   return getArch() == llvm::Triple::x86_64;
 }
 
index 6827034ef4ca6b66b6a5582dbc03cf56b7774a2f..080e0d65040b7e7c4731d8c3e0b3661a118b4cd5 100644 (file)
@@ -81,9 +81,7 @@ bool Windows::IsIntegratedAssemblerDefault() const {
 }
 
 bool Windows::IsUnwindTablesDefault() const {
-  // FIXME: Gross; we should probably have some separate target
-  // definition, possibly even reusing the one in clang.
-  return getArchName() == "x86_64";
+  return getArch() == llvm::Triple::x86_64;
 }
 
 const char *Windows::GetDefaultRelocationModel() const {
index 46aa3e11eb5ebe156e828102e99e499bfdfaf2cd..0ab37348d0c9382608ba6ce44a757ae9b9f010b4 100644 (file)
 // AMD64: "-triple"
 // AMD64: "amd64-unknown-openbsd5.2"
 // AMD64: "-munwind-tables"
+
+// RUN: %clang -target amd64--mingw32 -### -S %s 2>&1 | \
+// RUN: FileCheck -check-prefix=AMD64-MINGW %s
+// AMD64-MINGW: clang
+// AMD64-MINGW: "-cc1"
+// AMD64-MINGW: "-triple"
+// AMD64-MINGW: "amd64--mingw32"
+// AMD64-MINGW: "-munwind-tables"