[llvm] draft: inline asm mode (PR #146215)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 28 08:18:32 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 h,cpp -- llvm/include/llvm/MC/MCStreamer.h llvm/lib/MC/MCParser/AsmParser.cpp llvm/lib/MC/MCStreamer.cpp
``````````

</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 b93d6e62e..1515d4479 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -5920,7 +5920,8 @@ bool AsmParser::parseDirectiveLTODiscard() {
 ///  ::= ".inline_asm_mode" ( "strict" | "relaxed" )
 bool AsmParser::parseDirectiveInlineAsmMode(SMLoc DirectiveLoc) {
   if (getLexer().isNot(AsmToken::Identifier)) {
-    return Error(DirectiveLoc, "expected 'strict' or 'relaxed' after '.inline_asm_mode'");
+    return Error(DirectiveLoc,
+                 "expected 'strict' or 'relaxed' after '.inline_asm_mode'");
   }
 
   StringRef Mode = getTok().getIdentifier();
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index da2ab9a40..0abac03c5 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/lib/MC/MCStreamer.cpp
@@ -403,8 +403,8 @@ void MCStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
   if (InlineAsmStrictMode) {
     StringRef Name = Symbol->getName();
     if (!Name.empty() && !Name.starts_with(".L") && !Name.starts_with("L..") &&
-        !Name.starts_with("$") && !Name.starts_with("__") && Name.front() != '.' &&
-        !std::isdigit(Name.front())) {
+        !Name.starts_with("$") && !Name.starts_with("__") &&
+        Name.front() != '.' && !std::isdigit(Name.front())) {
       getContext().reportWarning(
           Loc, "non-local label '" + Name +
                    "' in inline assembly strict mode may be unsafe for "

``````````

</details>


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


More information about the llvm-commits mailing list