[clang] [clang-tools-extra] [llvm] [OptTable] Store Info strings in the string table (PR #218845)

via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 6 02:02:58 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- clang-tools-extra/clangd/CompileCommands.cpp clang/lib/Options/DriverOptions.cpp llvm/include/llvm/Option/OptTable.h llvm/include/llvm/Option/Option.h llvm/lib/Option/OptTable.cpp llvm/lib/Option/Option.cpp llvm/unittests/Option/OptionParsingTest.cpp llvm/utils/TableGen/OptionParserEmitter.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Option/OptTable.cpp b/llvm/lib/Option/OptTable.cpp
index a7728f5a5..ef3a4c694 100644
--- a/llvm/lib/Option/OptTable.cpp
+++ b/llvm/lib/Option/OptTable.cpp
@@ -641,8 +641,7 @@ static std::string getOptionHelpName(const OptTable &Opts, OptSpecifier Id) {
     [[fallthrough]];
   case Option::JoinedClass: case Option::CommaJoinedClass:
   case Option::JoinedAndSeparateClass:
-    if (StringRef MetaVarName = Opts.getOptionMetaVar(Id);
-        !MetaVarName.empty())
+    if (StringRef MetaVarName = Opts.getOptionMetaVar(Id); !MetaVarName.empty())
       Name += MetaVarName;
     else
       Name += "<value>";

``````````

</details>


https://github.com/llvm/llvm-project/pull/218845


More information about the cfe-commits mailing list