[llvm] [win][x64] SetFrame does not count as a stack alloc for unwind v2 (PR #154235)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 21 09:51:26 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 cpp -- llvm/lib/MC/MCWin64EH.cpp llvm/lib/Target/X86/X86WinEHUnwindV2.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/MC/MCWin64EH.cpp b/llvm/lib/MC/MCWin64EH.cpp
index 2638b9528..c198ecb71 100644
--- a/llvm/lib/MC/MCWin64EH.cpp
+++ b/llvm/lib/MC/MCWin64EH.cpp
@@ -40,10 +40,9 @@ public:
   static MCUnwindV2EpilogTargetExpr *
   create(const WinEH::FrameInfo &FrameInfo,
          const WinEH::FrameInfo::Epilog &Epilog, uint8_t EpilogSize_,
-         StringRef FunctionName_,
-         MCContext &Ctx) {
+         StringRef FunctionName_, MCContext &Ctx) {
     return new (Ctx) MCUnwindV2EpilogTargetExpr(FrameInfo, Epilog, EpilogSize_,
-                                                 FunctionName_);
+                                                FunctionName_);
   }
 
   void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override {
@@ -339,8 +338,8 @@ static void EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info) {
       // Each epilog is emitted as a fixup, since we can't measure the distance
       // between the start of the epilog and the end of the function until
       // layout has been completed.
-      auto *MCE = MCUnwindV2EpilogTargetExpr::create(*info, Epilog.second,
-                                                     EpilogSize, info->Function->getName(), context);
+      auto *MCE = MCUnwindV2EpilogTargetExpr::create(
+          *info, Epilog.second, EpilogSize, info->Function->getName(), context);
       OS->addFixup(MCE, FK_Data_2);
       OS->appendContents(2, 0);
     }
@@ -386,7 +385,8 @@ bool MCUnwindV2EpilogTargetExpr::evaluateAsRelocatableImpl(
   auto Offset = GetOptionalAbsDifference(*Asm, FunctionEnd, UnwindV2Start);
   if (!Offset) {
     Asm->getContext().reportError(
-        Loc, "Failed to evaluate epilog offset for Unwind v2 in " + FunctionName);
+        Loc,
+        "Failed to evaluate epilog offset for Unwind v2 in " + FunctionName);
     return false;
   }
   assert(*Offset > 0);
@@ -394,8 +394,9 @@ bool MCUnwindV2EpilogTargetExpr::evaluateAsRelocatableImpl(
   if (*Offset > MaxEpilogOffset) {
     dbgs() << "Unwindv2: " << UnwindV2Start->getSection().getName();
     dbgs() << "FunctionEnd: " << FunctionEnd->getSection().getName();
-    Asm->getContext().reportError(Loc,
-                                  "Epilog offset is too large (0x" + Twine::utohexstr(*Offset) + ") for Unwind v2 in " + FunctionName);
+    Asm->getContext().reportError(
+        Loc, "Epilog offset is too large (0x" + Twine::utohexstr(*Offset) +
+                 ") for Unwind v2 in " + FunctionName);
     return false;
   }
 

``````````

</details>


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


More information about the llvm-commits mailing list