[llvm] 2d8ce08 - [AArch64] Stop creating unnecessary label MCSymbols for each Windows unwind opcode. NFC.

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu May 12 05:25:46 PDT 2022


Author: Martin Storsjö
Date: 2022-05-12T15:23:04+03:00
New Revision: 2d8ce08b0973ef3096ea0292e600d164a5e65afb

URL: https://github.com/llvm/llvm-project/commit/2d8ce08b0973ef3096ea0292e600d164a5e65afb
DIFF: https://github.com/llvm/llvm-project/commit/2d8ce08b0973ef3096ea0292e600d164a5e65afb.diff

LOG: [AArch64] Stop creating unnecessary label MCSymbols for each Windows unwind opcode. NFC.

These labels aren't needed in the ARM version of WinEH tables, as each
unwind opcode maps to a specific instruction (each opcode is assumed
to represent one instruction), and the written tables don't contain
offsets like on x86_64.

Differential Revision: https://reviews.llvm.org/D125369

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp
index 27a1800ba5538..cad262077e5ac 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp
@@ -72,8 +72,7 @@ void AArch64TargetWinCOFFStreamer::emitARM64WinUnwindCode(unsigned UnwindCode,
   WinEH::FrameInfo *CurFrame = S.EnsureValidWinFrameInfo(SMLoc());
   if (!CurFrame)
     return;
-  MCSymbol *Label = S.emitCFILabel();
-  auto Inst = WinEH::Instruction(UnwindCode, Label, Reg, Offset);
+  auto Inst = WinEH::Instruction(UnwindCode, /*Label=*/nullptr, Reg, Offset);
   if (InEpilogCFI)
     CurFrame->EpilogMap[CurrentEpilog].push_back(Inst);
   else
@@ -177,7 +176,8 @@ void AArch64TargetWinCOFFStreamer::emitARM64WinCFIPrologEnd() {
 
   MCSymbol *Label = S.emitCFILabel();
   CurFrame->PrologEnd = Label;
-  WinEH::Instruction Inst = WinEH::Instruction(Win64EH::UOP_End, Label, -1, 0);
+  WinEH::Instruction Inst =
+      WinEH::Instruction(Win64EH::UOP_End, /*Label=*/nullptr, -1, 0);
   auto it = CurFrame->Instructions.begin();
   CurFrame->Instructions.insert(it, Inst);
 }
@@ -199,8 +199,8 @@ void AArch64TargetWinCOFFStreamer::emitARM64WinCFIEpilogEnd() {
     return;
 
   InEpilogCFI = false;
-  MCSymbol *Label = S.emitCFILabel();
-  WinEH::Instruction Inst = WinEH::Instruction(Win64EH::UOP_End, Label, -1, 0);
+  WinEH::Instruction Inst =
+      WinEH::Instruction(Win64EH::UOP_End, /*Label=*/nullptr, -1, 0);
   CurFrame->EpilogMap[CurrentEpilog].push_back(Inst);
   CurrentEpilog = nullptr;
 }


        


More information about the llvm-commits mailing list