Update LLVM and fix formatv issues. (#4282)

https://github.com/llvm/llvm-project/pull/105745 increased validation of
formatv requirements, this fixes a couple issues.

Note the CommandLine case was untested, and caught separately.
This commit is contained in:
Jon Ross-Perkins
2024-09-09 23:54:35 +00:00
committed by GitHub
parent f641cb95d2
commit 43c6259fb2
4 changed files with 24 additions and 11 deletions
+7 -3
View File
@@ -927,9 +927,13 @@ auto Parser::ParseArg(const Arg& arg, bool short_spelling,
return ParseFlag(arg, value);
}
auto name =
llvm::formatv(short_spelling ? "'-{0}' (short for '--{1}')" : "'--{1}'",
arg.info.short_name, arg.info.name);
std::string name;
if (short_spelling) {
name = llvm::formatv("'-{0}' (short for '--{1}')", arg.info.short_name,
arg.info.name);
} else {
name = llvm::formatv("'--{0}'", arg.info.name);
}
if (!value) {
// We can't have a positional argument without a value, so we know this is