[llvm] [Metadata] Return the valid DebugLoc if one of them is null with -pick-merged-source-locations. (PR #138148)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 1 08:23:13 PDT 2025


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 HEAD~1 HEAD --extensions cpp -- llvm/lib/IR/DebugInfoMetadata.cpp llvm/unittests/IR/MetadataTest.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp
index e0d96aab5..45860d60d 100644
--- a/llvm/unittests/IR/MetadataTest.cpp
+++ b/llvm/unittests/IR/MetadataTest.cpp
@@ -26,7 +26,7 @@
 using namespace llvm;
 
 namespace llvm {
-  extern cl::opt<bool> PickMergedSourceLocations;
+extern cl::opt<bool> PickMergedSourceLocations;
 } // namespace llvm
 
 namespace {
@@ -1458,13 +1458,13 @@ TEST_F(DILocationTest, Merge) {
     ASSERT_NE(nullptr, M1);
     EXPECT_EQ(2u, M1->getLine());
     EXPECT_EQ(7u, M1->getColumn());
-    EXPECT_EQ(N,  M1->getScope());
+    EXPECT_EQ(N, M1->getScope());
 
     auto *M2 = DILocation::getMergedLocation(nullptr, A);
     ASSERT_NE(nullptr, M2);
     EXPECT_EQ(2u, M2->getLine());
     EXPECT_EQ(7u, M2->getColumn());
-    EXPECT_EQ(N,  M2->getScope());
+    EXPECT_EQ(N, M2->getScope());
     PickMergedSourceLocations = false;
   }
 }

``````````

</details>


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


More information about the llvm-commits mailing list