[llvm-branch-commits] [llvm] [Support] Use LLVM naming conventions in SourceMgrDiagnosticVerifier. NFC (PR #227566)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Sep 29 22:51:56 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 h,cpp -- llvm/include/llvm/Support/SourceMgrDiagnosticVerifier.h llvm/lib/Support/SourceMgrDiagnosticVerifier.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/include/llvm/Support/SourceMgrDiagnosticVerifier.h b/llvm/include/llvm/Support/SourceMgrDiagnosticVerifier.h
index 2e2240071..a0a23c259 100644
--- a/llvm/include/llvm/Support/SourceMgrDiagnosticVerifier.h
+++ b/llvm/include/llvm/Support/SourceMgrDiagnosticVerifier.h
@@ -128,9 +128,8 @@ private:
   SmallVector<ExpectedDiag, 2> ExpectedUnknownLocDiags;
 
   /// Regex used to recognize 'expected-<kind>' comments.
-  Regex Expected =
-      Regex("expected-(error|note|remark|warning)(-re)? "
-            "*(@([+-][0-9]+|above|below|unknown))? *{{(.*)}}$");
+  Regex Expected = Regex("expected-(error|note|remark|warning)(-re)? "
+                         "*(@([+-][0-9]+|above|below|unknown))? *{{(.*)}}$");
 
   /// Whether any diagnostic mismatch has been recorded so far.
   bool OK = true;
diff --git a/llvm/lib/Support/SourceMgrDiagnosticVerifier.cpp b/llvm/lib/Support/SourceMgrDiagnosticVerifier.cpp
index bb36c9263..a031adb77 100644
--- a/llvm/lib/Support/SourceMgrDiagnosticVerifier.cpp
+++ b/llvm/lib/Support/SourceMgrDiagnosticVerifier.cpp
@@ -27,9 +27,8 @@ static StringRef getDiagKindStr(SourceMgr::DiagKind Kind) {
   llvm_unreachable("Unknown SourceMgr::DiagKind");
 }
 
-bool SourceMgrDiagnosticVerifier::ExpectedDiag::emitError(raw_ostream &OS,
-                                                          SourceMgr &Mgr,
-                                                          const Twine &Msg) const {
+bool SourceMgrDiagnosticVerifier::ExpectedDiag::emitError(
+    raw_ostream &OS, SourceMgr &Mgr, const Twine &Msg) const {
   if (FileLoc.isValid()) {
     SMRange Range(FileLoc, SMLoc::getFromPointer(FileLoc.getPointer() +
                                                  Substring.size()));
@@ -180,10 +179,11 @@ SourceMgrDiagnosticVerifier::getExpectedDiags(StringRef BufName) {
   return std::nullopt;
 }
 
-SourceMgrDiagnosticVerifier::MatchResult SourceMgrDiagnosticVerifier::process(
-    raw_ostream &OS, SourceMgr &Mgr, SourceMgr::DiagKind Kind, bool HasLoc,
-    const MemoryBuffer *Buf, unsigned LineNo, StringRef Message,
-    bool ReportUnexpected) {
+SourceMgrDiagnosticVerifier::MatchResult
+SourceMgrDiagnosticVerifier::process(raw_ostream &OS, SourceMgr &Mgr,
+                                     SourceMgr::DiagKind Kind, bool HasLoc,
+                                     const MemoryBuffer *Buf, unsigned LineNo,
+                                     StringRef Message, bool ReportUnexpected) {
   MutableArrayRef<ExpectedDiag> Diags;
   if (HasLoc) {
     // If the buffer couldn't be resolved, `Diags` stays empty: a diagnostic

``````````

</details>


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


More information about the llvm-branch-commits mailing list