[clang] [NFC][clang] Format pragma comment kind StringSwitch (PR #201754)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 4 22:58:51 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Tony Varghese (tonykuttai)
<details>
<summary>Changes</summary>
This is a formatting-only change to the pragma comment kind `StringSwitch`.
A follow-up change needs to add another pragma comment kind to this block. Applying the formatter as part of that functional change would also reformat the existing cases, making the functional diff harder to review.
No functional change intended.
---
Full diff: https://github.com/llvm/llvm-project/pull/201754.diff
1 Files Affected:
- (modified) clang/lib/Parse/ParsePragma.cpp (+7-7)
``````````diff
diff --git a/clang/lib/Parse/ParsePragma.cpp b/clang/lib/Parse/ParsePragma.cpp
index cb792e175ee7c..237874de9f8a3 100644
--- a/clang/lib/Parse/ParsePragma.cpp
+++ b/clang/lib/Parse/ParsePragma.cpp
@@ -3292,13 +3292,13 @@ void PragmaCommentHandler::HandlePragma(Preprocessor &PP,
// Verify that this is one of the 5 explicitly listed options.
IdentifierInfo *II = Tok.getIdentifierInfo();
PragmaMSCommentKind Kind =
- llvm::StringSwitch<PragmaMSCommentKind>(II->getName())
- .Case("linker", PCK_Linker)
- .Case("lib", PCK_Lib)
- .Case("compiler", PCK_Compiler)
- .Case("exestr", PCK_ExeStr)
- .Case("user", PCK_User)
- .Default(PCK_Unknown);
+ llvm::StringSwitch<PragmaMSCommentKind>(II->getName())
+ .Case("linker", PCK_Linker)
+ .Case("lib", PCK_Lib)
+ .Case("compiler", PCK_Compiler)
+ .Case("exestr", PCK_ExeStr)
+ .Case("user", PCK_User)
+ .Default(PCK_Unknown);
if (Kind == PCK_Unknown) {
PP.Diag(Tok.getLocation(), diag::err_pragma_comment_unknown_kind);
return;
``````````
</details>
https://github.com/llvm/llvm-project/pull/201754
More information about the cfe-commits
mailing list