[llvm] [MIR] Replace bespoke DIExpression parser (PR #96827)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 1 14:34:57 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 0c56fd0a29ffb0425ca2ee2a4ff8f380880fdbfa d0c1d00b59fb12757ba881d990d2f1f29787417a -- llvm/include/llvm/AsmParser/LLParser.h llvm/include/llvm/AsmParser/Parser.h llvm/lib/AsmParser/LLParser.cpp llvm/lib/AsmParser/Parser.cpp llvm/lib/CodeGen/MIRParser/MIParser.cpp llvm/unittests/AsmParser/AsmParserTest.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/unittests/AsmParser/AsmParserTest.cpp b/llvm/unittests/AsmParser/AsmParserTest.cpp
index 1cef212b70..a8cffb8ff2 100644
--- a/llvm/unittests/AsmParser/AsmParserTest.cpp
+++ b/llvm/unittests/AsmParser/AsmParserTest.cpp
@@ -415,20 +415,19 @@ TEST(AsmParserTest, InvalidDataLayoutStringCallback) {
 TEST(AsmParserTest, DIExpressionBodyAtBeginningWithSlotMappingParsing) {
   LLVMContext Ctx;
   SMDiagnostic Error;
-  StringRef Source =
-      "%st = type { i32, i32 }\n"
-      "@v = common global [50 x %st] zeroinitializer, align 16\n"
-      "%0 = type { i32, i32, i32, i32 }\n"
-      "@g = common global [50 x %0] zeroinitializer, align 16\n"
-      "define void @marker4(i64 %d) {\n"
-      "entry:\n"
-      "  %conv = trunc i64 %d to i32\n"
-      "  store i32 %conv, ptr getelementptr inbounds "
-      "    ([50 x %st], ptr @v, i64 0, i64 0, i32 0), align 16\n"
-      "  store i32 %conv, ptr getelementptr inbounds "
-      "    ([50 x %0], ptr @g, i64 0, i64 0, i32 0), align 16\n"
-      "  ret void\n"
-      "}";
+  StringRef Source = "%st = type { i32, i32 }\n"
+                     "@v = common global [50 x %st] zeroinitializer, align 16\n"
+                     "%0 = type { i32, i32, i32, i32 }\n"
+                     "@g = common global [50 x %0] zeroinitializer, align 16\n"
+                     "define void @marker4(i64 %d) {\n"
+                     "entry:\n"
+                     "  %conv = trunc i64 %d to i32\n"
+                     "  store i32 %conv, ptr getelementptr inbounds "
+                     "    ([50 x %st], ptr @v, i64 0, i64 0, i32 0), align 16\n"
+                     "  store i32 %conv, ptr getelementptr inbounds "
+                     "    ([50 x %0], ptr @g, i64 0, i64 0, i32 0), align 16\n"
+                     "  ret void\n"
+                     "}";
   SlotMapping Mapping;
   auto Mod = parseAssemblyString(Source, Error, Ctx, &Mapping);
   ASSERT_TRUE(Mod != nullptr);
@@ -445,7 +444,8 @@ TEST(AsmParserTest, DIExpressionBodyAtBeginningWithSlotMappingParsing) {
   ASSERT_TRUE(Expr);
   ASSERT_EQ(Expr->getNumElements(), 1u);
 
-  Expr = parseDIExpressionBodyAtBeginning("(DW_OP_LLVM_fragment, 0, 1)", Read, Error, M, &Mapping);
+  Expr = parseDIExpressionBodyAtBeginning("(DW_OP_LLVM_fragment, 0, 1)", Read,
+                                          Error, M, &Mapping);
   ASSERT_TRUE(Expr);
   ASSERT_EQ(Expr->getNumElements(), 3u);
 
@@ -455,7 +455,8 @@ TEST(AsmParserTest, DIExpressionBodyAtBeginningWithSlotMappingParsing) {
   ASSERT_EQ(Error.getMessage(), "expected '(' here");
 
   Error = {};
-  Expr = parseDIExpressionBodyAtBeginning("!DIExpression(DW_OP_LLVM_fragment, 0, 1)", Read, Error, M, &Mapping);
+  Expr = parseDIExpressionBodyAtBeginning(
+      "!DIExpression(DW_OP_LLVM_fragment, 0, 1)", Read, Error, M, &Mapping);
   ASSERT_FALSE(Expr);
   ASSERT_EQ(Error.getMessage(), "expected '(' here");
 }

``````````

</details>


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


More information about the llvm-commits mailing list