[clang] [llvm] PowerPC: Support Atomic Memory Operations in Inline Asm (PR #163616)

via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 15 12:08:06 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 origin/main HEAD --extensions c,cpp -- clang/test/CodeGen/PowerPC/inline-asm-constraints.c llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp llvm/lib/Target/PowerPC/PPCISelLowering.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/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 2e31ea739..448b03ee2 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -411,14 +411,16 @@ bool PPCAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
 bool PPCAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
                                           const char *ExtraCode,
                                           raw_ostream &O) {
-  auto reportAsmMemError = [&] (StringRef errMsg) {
+  auto reportAsmMemError = [&](StringRef errMsg) {
     const char *AsmStr = MI->getOperand(0).getSymbolName();
     const MDNode *LocMD = MI->getLocCookieMD();
-    uint64_t LocCookie = LocMD ?
-     mdconst::extract<ConstantInt>(LocMD->getOperand(0))->getZExtValue() : 0;
+    uint64_t LocCookie =
+        LocMD ? mdconst::extract<ConstantInt>(LocMD->getOperand(0))
+                    ->getZExtValue()
+              : 0;
     const Function &Fn = MI->getMF()->getFunction();
-    Fn.getContext().diagnose(DiagnosticInfoInlineAsm(
-        LocCookie, errMsg + Twine(AsmStr) + "'"));
+    Fn.getContext().diagnose(
+        DiagnosticInfoInlineAsm(LocCookie, errMsg + Twine(AsmStr) + "'"));
     return true;
   };
   if (ExtraCode && ExtraCode[0]) {

``````````

</details>


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


More information about the cfe-commits mailing list