diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-10-07 03:23:40 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-10-07 03:23:40 +0000 |
commit | a4a809e23ef17bef21afc50e70412a77567807ae (patch) | |
tree | dd8233c0e31fa46c1c28cb4520b87792d103f56a | |
parent | 09fa33bfe7c7f02bb18c78c5e15522fb99a9f357 (diff) |
Use getArch instead of getArchName.
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
-rw-r--r-- | lib/Driver/ToolChains.cpp | 6 | ||||
-rw-r--r-- | lib/Driver/WindowsToolChain.cpp | 4 | ||||
-rw-r--r-- | test/Driver/clang-translation.c | 8 |
3 files changed, 10 insertions, 8 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 27375de27d..54f8c42294 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -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; } diff --git a/lib/Driver/WindowsToolChain.cpp b/lib/Driver/WindowsToolChain.cpp index 6827034ef4..080e0d6504 100644 --- a/lib/Driver/WindowsToolChain.cpp +++ b/lib/Driver/WindowsToolChain.cpp @@ -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 { diff --git a/test/Driver/clang-translation.c b/test/Driver/clang-translation.c index 46aa3e11eb..0ab37348d0 100644 --- a/test/Driver/clang-translation.c +++ b/test/Driver/clang-translation.c @@ -91,3 +91,11 @@ // 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" |