[Driver] Fix -f[no-]unwind-tables -Wunused-command-line-argument after 4388b56d52

This commit is contained in:
Fangrui Song 2022-09-20 20:13:30 -07:00
parent 1cbf44bd50
commit 669e508772
2 changed files with 4 additions and 3 deletions

View File

@ -5469,13 +5469,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
auto SanitizeArgs = TC.getSanitizerArgs(Args);
auto UnwindTables = TC.getDefaultUnwindTableLevel(Args);
const bool HasSyncUnwindTables = Args.hasFlag(
options::OPT_funwind_tables, options::OPT_fno_unwind_tables, false);
if (Args.hasFlag(options::OPT_fasynchronous_unwind_tables,
options::OPT_fno_asynchronous_unwind_tables,
SanitizeArgs.needsUnwindTables()) &&
!Freestanding)
UnwindTables = ToolChain::UnwindTableLevel::Asynchronous;
else if (Args.hasFlag(options::OPT_funwind_tables,
options::OPT_fno_unwind_tables, false))
else if (HasSyncUnwindTables)
UnwindTables = ToolChain::UnwindTableLevel::Synchronous;
else if (Args.hasFlag(options::OPT_fno_unwind_tables,
options::OPT_fno_asynchronous_unwind_tables,

View File

@ -10,7 +10,7 @@
// I386: "-o"
// I386: clang-translation
// RUN: %clang -target i386-unknown-unknown -### -S %s -fasynchronous-unwind-tables -fno-unwind-tables 2>&1 | FileCheck --check-prefix=UNWIND-TABLES %s
// 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:
// UNWIND-TABLES: "-funwind-tables=2"
// RUN: %clang -target i386-apple-darwin9 -### -S %s -o %t.s 2>&1 | \