Skip to content

Commit 669e508

Browse files
committed
[Driver] Fix -f[no-]unwind-tables -Wunused-command-line-argument after 4388b56
1 parent 1cbf44b commit 669e508

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -5469,13 +5469,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
54695469
auto SanitizeArgs = TC.getSanitizerArgs(Args);
54705470
auto UnwindTables = TC.getDefaultUnwindTableLevel(Args);
54715471

5472+
const bool HasSyncUnwindTables = Args.hasFlag(
5473+
options::OPT_funwind_tables, options::OPT_fno_unwind_tables, false);
54725474
if (Args.hasFlag(options::OPT_fasynchronous_unwind_tables,
54735475
options::OPT_fno_asynchronous_unwind_tables,
54745476
SanitizeArgs.needsUnwindTables()) &&
54755477
!Freestanding)
54765478
UnwindTables = ToolChain::UnwindTableLevel::Asynchronous;
5477-
else if (Args.hasFlag(options::OPT_funwind_tables,
5478-
options::OPT_fno_unwind_tables, false))
5479+
else if (HasSyncUnwindTables)
54795480
UnwindTables = ToolChain::UnwindTableLevel::Synchronous;
54805481
else if (Args.hasFlag(options::OPT_fno_unwind_tables,
54815482
options::OPT_fno_asynchronous_unwind_tables,

clang/test/Driver/clang-translation.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// I386: "-o"
1111
// I386: clang-translation
1212

13-
// RUN: %clang -target i386-unknown-unknown -### -S %s -fasynchronous-unwind-tables -fno-unwind-tables 2>&1 | FileCheck --check-prefix=UNWIND-TABLES %s
13+
// RUN: %clang -target i386-unknown-unknown -### -S %s -fasynchronous-unwind-tables -fno-unwind-tables 2>&1 | FileCheck --check-prefix=UNWIND-TABLES %s --implicit-check-not=warning:
1414
// UNWIND-TABLES: "-funwind-tables=2"
1515

1616
// RUN: %clang -target i386-apple-darwin9 -### -S %s -o %t.s 2>&1 | \

0 commit comments

Comments
 (0)