diff options
author | Alexander Yermolovich <43973793+ayermolo@users.noreply.github.com> | 2023-12-18 12:47:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-18 12:47:24 -0800 |
commit | e409f85154fda5bd39436298741faa58178e6051 (patch) | |
tree | 5459e736c7ea3305c0c268a56599ed3e6d634a1f /llvm/tools/llvm-dwp/llvm-dwp.cpp | |
parent | 1821bc1e969bd2d0887fe115ae371506adc1a8be (diff) | |
download | llvm-e409f85154fda5bd39436298741faa58178e6051.zip llvm-e409f85154fda5bd39436298741faa58178e6051.tar.gz llvm-e409f85154fda5bd39436298741faa58178e6051.tar.bz2 |
[DWP] Fix default for continue-on-cu-index-overflow (#75540)
This is follow up for https://github.com/llvm/llvm-project/pull/71902.
The
default option --continue-on-cu-index-overflow returned an error
--continue-on-cu-index-overflow: missing argument. Changed it so that it
is the
same behavior as other flags like -gsplit-dwarf. Where
--continue-on-cu-index-overflow will default to continue, and user can
set mode
with --continue-on-cu-index-overflow=\<value>.
Diffstat (limited to 'llvm/tools/llvm-dwp/llvm-dwp.cpp')
-rw-r--r-- | llvm/tools/llvm-dwp/llvm-dwp.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp index 5cd4c00..a6b8643 100644 --- a/llvm/tools/llvm-dwp/llvm-dwp.cpp +++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp @@ -144,13 +144,21 @@ int llvm_dwp_main(int argc, char **argv, const llvm::ToolContext &) { } OutputFilename = Args.getLastArgValue(OPT_outputFileName, ""); - if (Args.hasArg(OPT_continueOnCuIndexOverflow)) { - ContinueOption = - Args.getLastArgValue(OPT_continueOnCuIndexOverflow, "continue"); - if (ContinueOption == "soft-stop") { - OverflowOptValue = OnCuIndexOverflow::SoftStop; - } else { + if (Arg *Arg = Args.getLastArg(OPT_continueOnCuIndexOverflow, + OPT_continueOnCuIndexOverflow_EQ)) { + if (Arg->getOption().matches(OPT_continueOnCuIndexOverflow)) { OverflowOptValue = OnCuIndexOverflow::Continue; + } else { + ContinueOption = Arg->getValue(); + if (ContinueOption == "soft-stop") { + OverflowOptValue = OnCuIndexOverflow::SoftStop; + } else if (ContinueOption == "continue") { + OverflowOptValue = OnCuIndexOverflow::Continue; + } else { + llvm::errs() << "invalid value for --continue-on-cu-index-overflow" + << ContinueOption << '\n'; + exit(1); + } } } |