Skip to content

Commit e8bd4e5

Browse files
committed
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". llvm-svn: 165368
1 parent e0b1dea commit e8bd4e5

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

clang/lib/Driver/ToolChains.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -955,9 +955,7 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args,
955955
}
956956

957957
bool Darwin::IsUnwindTablesDefault() const {
958-
// FIXME: Gross; we should probably have some separate target
959-
// definition, possibly even reusing the one in clang.
960-
return getArchName() == "x86_64";
958+
return getArch() == llvm::Triple::x86_64;
961959
}
962960

963961
bool Darwin::UseDwarfDebugFlags() const {
@@ -1457,8 +1455,6 @@ Tool &Generic_GCC::SelectTool(const Compilation &C,
14571455
}
14581456

14591457
bool Generic_GCC::IsUnwindTablesDefault() const {
1460-
// FIXME: Gross; we should probably have some separate target
1461-
// definition, possibly even reusing the one in clang.
14621458
return getArch() == llvm::Triple::x86_64;
14631459
}
14641460

clang/lib/Driver/WindowsToolChain.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ bool Windows::IsIntegratedAssemblerDefault() const {
8181
}
8282

8383
bool Windows::IsUnwindTablesDefault() const {
84-
// FIXME: Gross; we should probably have some separate target
85-
// definition, possibly even reusing the one in clang.
86-
return getArchName() == "x86_64";
84+
return getArch() == llvm::Triple::x86_64;
8785
}
8886

8987
const char *Windows::GetDefaultRelocationModel() const {

clang/test/Driver/clang-translation.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,11 @@
9191
// AMD64: "-triple"
9292
// AMD64: "amd64-unknown-openbsd5.2"
9393
// AMD64: "-munwind-tables"
94+
95+
// RUN: %clang -target amd64--mingw32 -### -S %s 2>&1 | \
96+
// RUN: FileCheck -check-prefix=AMD64-MINGW %s
97+
// AMD64-MINGW: clang
98+
// AMD64-MINGW: "-cc1"
99+
// AMD64-MINGW: "-triple"
100+
// AMD64-MINGW: "amd64--mingw32"
101+
// AMD64-MINGW: "-munwind-tables"

0 commit comments

Comments
 (0)