[llvm] [AsmParser] Fixed `assembler local symbol not defined` unable to locate the exact line number. (PR #219719)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 31 05:38:02 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/MC/MCContext.h llvm/lib/MC/MCExpr.cpp llvm/lib/MC/MCParser/AsmParser.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/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index 154dda365..bd923d99c 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -1051,12 +1051,14 @@ bool AsmParser::Run(bool NoInitialTextSection, bool NoFinalize) {
             ErrorLoc = getTok().getLoc();
 
           // Achieve underline annotation effect.
-          // If the start and end positions exist, retrieve the markers; otherwise, do nothing.
-          // Important: To reproduce this error, please specify the macOS platform.
+          // If the start and end positions exist, retrieve the markers;
+          // otherwise, do nothing. Important: To reproduce this error, please
+          // specify the macOS platform.
           SMRange SymbolRange;
           if (ErrorLoc.isValid()) {
             const char *StartPtr = ErrorLoc.getPointer();
-            SMLoc EndLoc = SMLoc::getFromPointer(StartPtr + Sym->getName().size());
+            SMLoc EndLoc =
+                SMLoc::getFromPointer(StartPtr + Sym->getName().size());
             SymbolRange = SMRange(ErrorLoc, EndLoc);
           }
 

``````````

</details>


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


More information about the llvm-commits mailing list