[llvm] [Support] Add option to print SMDiagnostic into a buffer without the filename and location info (PR #92050)
via llvm-commits
llvm-commits at lists.llvm.org
Mon May 13 16:57:55 PDT 2024
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 4c79d38f82e1f6fe8575d88d8c74f2f1806b19ce cbf509f2f66f988314eb5807b464a9e67dce06f6 -- llvm/include/llvm/Support/SourceMgr.h llvm/lib/Support/SourceMgr.cpp llvm/unittests/Support/SourceMgrTest.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/unittests/Support/SourceMgrTest.cpp b/llvm/unittests/Support/SourceMgrTest.cpp
index ebc8869c2f..75a0cfe35a 100644
--- a/llvm/unittests/Support/SourceMgrTest.cpp
+++ b/llvm/unittests/Support/SourceMgrTest.cpp
@@ -534,7 +534,8 @@ TEST_F(SourceMgrTest, FixitForTab) {
TEST_F(SourceMgrTest, PrintWithoutLoc) {
raw_string_ostream OS(Output);
- auto Diag = llvm::SMDiagnostic("file.in", llvm::SourceMgr::DK_Error, "message");
+ auto Diag =
+ llvm::SMDiagnostic("file.in", llvm::SourceMgr::DK_Error, "message");
Diag.print(nullptr, OS);
OS.flush();
EXPECT_EQ("file.in: error: message\n", Output);
``````````
</details>
https://github.com/llvm/llvm-project/pull/92050
More information about the llvm-commits
mailing list