[llvm] [X86] Check if an invoked function clobbers fp or bp (PR #103446)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 14:01:41 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 1248698e9bb2a0232eee53a72679ed5077190a90 d8f19c1dc44e7feed82ca18094c4d4573539e3cd --extensions cpp,h -- llvm/lib/Target/X86/X86ISelLoweringCall.cpp llvm/lib/Target/X86/X86MachineFunctionInfo.h llvm/lib/Target/X86/X86RegisterInfo.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp
index cea3ece2e3..57e9edb5bc 100644
--- a/llvm/lib/Target/X86/X86RegisterInfo.cpp
+++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp
@@ -568,8 +568,8 @@ BitVector X86RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
   if (TFI->hasFP(MF)) {
     if (MF.getInfo<X86MachineFunctionInfo>()->getFPClobberedByInvoke())
       MF.getContext().reportError(
-        SMLoc(),
-        "Frame pointer clobbered by function invoke is not supported.");
+          SMLoc(),
+          "Frame pointer clobbered by function invoke is not supported.");
 
     for (const MCPhysReg &SubReg : subregs_inclusive(X86::RBP))
       Reserved.set(SubReg);
@@ -578,10 +578,10 @@ BitVector X86RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
   // Set the base-pointer register and its aliases as reserved if needed.
   if (hasBasePointer(MF)) {
     if (MF.getInfo<X86MachineFunctionInfo>()->getBPClobberedByInvoke())
-      MF.getContext().reportError(
-        SMLoc(),
-        "Stack realignment in presence of dynamic allocas is not supported with"
-        "this calling convention.");
+      MF.getContext().reportError(SMLoc(),
+                                  "Stack realignment in presence of dynamic "
+                                  "allocas is not supported with"
+                                  "this calling convention.");
 
     Register BasePtr = getX86SubSuperRegister(getBaseRegister(), 64);
     for (const MCPhysReg &SubReg : subregs_inclusive(BasePtr))

``````````

</details>


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


More information about the llvm-commits mailing list