[llvm] 918f6f5 - [AArch64] [SEH] Rename pac_sign_return_address to pac_sign_lr
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 12 12:22:02 PDT 2022
Author: Martin Storsjö
Date: 2022-10-12T22:19:59+03:00
New Revision: 918f6f581d35f413809eb5e661129690a7be2cab
URL: https://github.com/llvm/llvm-project/commit/918f6f581d35f413809eb5e661129690a7be2cab
DIFF: https://github.com/llvm/llvm-project/commit/918f6f581d35f413809eb5e661129690a7be2cab.diff
LOG: [AArch64] [SEH] Rename pac_sign_return_address to pac_sign_lr
This new opcode was initially documented as "pac_sign_return_address"
in https://github.com/MicrosoftDocs/cpp-docs/pull/4202, but was
soon afterwards renamed into "pac_sign_lr" in
https://github.com/MicrosoftDocs/cpp-docs/pull/4209, as the other
name was unwieldy, and there were no other external references to
that name anywhere.
Rename our external .seh assembler directive - it hasn't been merged
for very long yet, so there's probably no external use to account for.
Rename all other internal references to the opcode similarly.
Differential Revision: https://reviews.llvm.org/D135762
Added:
Modified:
llvm/include/llvm/Support/Win64EH.h
llvm/lib/MC/MCWin64EH.cpp
llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.h
llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp
llvm/test/MC/AArch64/seh-packed-unwind.s
llvm/test/MC/AArch64/seh.s
llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
llvm/tools/llvm-readobj/ARMWinEHPrinter.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Support/Win64EH.h b/llvm/include/llvm/Support/Win64EH.h
index 4bc3d81070645..93401bdc131eb 100644
--- a/llvm/include/llvm/Support/Win64EH.h
+++ b/llvm/include/llvm/Support/Win64EH.h
@@ -61,7 +61,7 @@ enum UnwindOpcodes {
UOP_TrapFrame,
UOP_Context,
UOP_ClearUnwoundToCall,
- UOP_PACSignReturnAddress,
+ UOP_PACSignLR,
// The following set of unwind opcodes is for ARM. They are documented at
// https://docs.microsoft.com/en-us/cpp/build/arm-exception-handling
diff --git a/llvm/lib/MC/MCWin64EH.cpp b/llvm/lib/MC/MCWin64EH.cpp
index d2afb9cf03295..6992048a39f58 100644
--- a/llvm/lib/MC/MCWin64EH.cpp
+++ b/llvm/lib/MC/MCWin64EH.cpp
@@ -377,7 +377,7 @@ static uint32_t ARM64CountOfUnwindCodes(ArrayRef<WinEH::Instruction> Insns) {
case Win64EH::UOP_ClearUnwoundToCall:
Count += 1;
break;
- case Win64EH::UOP_PACSignReturnAddress:
+ case Win64EH::UOP_PACSignLR:
Count += 1;
break;
}
@@ -546,7 +546,7 @@ static void ARM64EmitUnwindCode(MCStreamer &streamer,
b = 0xEC;
streamer.emitInt8(b);
break;
- case Win64EH::UOP_PACSignReturnAddress:
+ case Win64EH::UOP_PACSignLR:
b = 0xFC;
streamer.emitInt8(b);
break;
@@ -759,7 +759,7 @@ static bool tryARM64PackedUnwind(WinEH::FrameInfo *info, uint32_t FuncLength,
return false;
Location = Start2;
break;
- case Win64EH::UOP_PACSignReturnAddress:
+ case Win64EH::UOP_PACSignLR:
if (Location != Start2)
return false;
PAC = true;
diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
index ebc4e53b7a6c5..6dbc3040f7391 100644
--- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -218,7 +218,7 @@ class AArch64AsmParser : public MCTargetAsmParser {
bool parseDirectiveSEHMachineFrame(SMLoc L);
bool parseDirectiveSEHContext(SMLoc L);
bool parseDirectiveSEHClearUnwoundToCall(SMLoc L);
- bool parseDirectiveSEHPACSignReturnAddress(SMLoc L);
+ bool parseDirectiveSEHPACSignLR(SMLoc L);
bool validateInstruction(MCInst &Inst, SMLoc &IDLoc,
SmallVectorImpl<SMLoc> &Loc);
@@ -6100,8 +6100,8 @@ bool AArch64AsmParser::ParseDirective(AsmToken DirectiveID) {
parseDirectiveSEHContext(Loc);
else if (IDVal == ".seh_clear_unwound_to_call")
parseDirectiveSEHClearUnwoundToCall(Loc);
- else if (IDVal == ".seh_pac_sign_return_address")
- parseDirectiveSEHPACSignReturnAddress(Loc);
+ else if (IDVal == ".seh_pac_sign_lr")
+ parseDirectiveSEHPACSignLR(Loc);
else
return true;
} else
@@ -6778,10 +6778,10 @@ bool AArch64AsmParser::parseDirectiveSEHClearUnwoundToCall(SMLoc L) {
return false;
}
-/// parseDirectiveSEHPACSignReturnAddress
-/// ::= .seh_pac_sign_return_address
-bool AArch64AsmParser::parseDirectiveSEHPACSignReturnAddress(SMLoc L) {
- getTargetStreamer().emitARM64WinCFIPACSignReturnAddress();
+/// parseDirectiveSEHPACSignLR
+/// ::= .seh_pac_sign_lr
+bool AArch64AsmParser::parseDirectiveSEHPACSignLR(SMLoc L) {
+ getTargetStreamer().emitARM64WinCFIPACSignLR();
return false;
}
diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
index 983a38420e9d1..ec09ca2ba67d2 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
@@ -107,8 +107,8 @@ class AArch64TargetAsmStreamer : public AArch64TargetStreamer {
void emitARM64WinCFIClearUnwoundToCall() override {
OS << "\t.seh_clear_unwound_to_call\n";
}
- void emitARM64WinCFIPACSignReturnAddress() override {
- OS << "\t.seh_pac_sign_return_address\n";
+ void emitARM64WinCFIPACSignLR() override {
+ OS << "\t.seh_pac_sign_lr\n";
}
public:
diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.h b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.h
index bdccb99d257b7..0a13e8526ec62 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.h
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.h
@@ -67,7 +67,7 @@ class AArch64TargetStreamer : public MCTargetStreamer {
virtual void emitARM64WinCFIMachineFrame() {}
virtual void emitARM64WinCFIContext() {}
virtual void emitARM64WinCFIClearUnwoundToCall() {}
- virtual void emitARM64WinCFIPACSignReturnAddress() {}
+ virtual void emitARM64WinCFIPACSignLR() {}
private:
std::unique_ptr<AssemblerConstantPools> ConstantPools;
@@ -121,7 +121,7 @@ class AArch64TargetWinCOFFStreamer : public llvm::AArch64TargetStreamer {
void emitARM64WinCFIMachineFrame() override;
void emitARM64WinCFIContext() override;
void emitARM64WinCFIClearUnwoundToCall() override;
- void emitARM64WinCFIPACSignReturnAddress() override;
+ void emitARM64WinCFIPACSignLR() override;
private:
void emitARM64WinUnwindCode(unsigned UnwindCode, int Reg, int Offset);
diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp
index 0188bb1ade181..26c066c24e5e3 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp
@@ -221,8 +221,8 @@ void AArch64TargetWinCOFFStreamer::emitARM64WinCFIClearUnwoundToCall() {
emitARM64WinUnwindCode(Win64EH::UOP_ClearUnwoundToCall, -1, 0);
}
-void AArch64TargetWinCOFFStreamer::emitARM64WinCFIPACSignReturnAddress() {
- emitARM64WinUnwindCode(Win64EH::UOP_PACSignReturnAddress, -1, 0);
+void AArch64TargetWinCOFFStreamer::emitARM64WinCFIPACSignLR() {
+ emitARM64WinUnwindCode(Win64EH::UOP_PACSignLR, -1, 0);
}
MCWinCOFFStreamer *llvm::createAArch64WinCOFFStreamer(
diff --git a/llvm/test/MC/AArch64/seh-packed-unwind.s b/llvm/test/MC/AArch64/seh-packed-unwind.s
index 4276c7fb4ff4f..ab2d27f8f3a52 100644
--- a/llvm/test/MC/AArch64/seh-packed-unwind.s
+++ b/llvm/test/MC/AArch64/seh-packed-unwind.s
@@ -729,7 +729,7 @@ func15:
func16:
.seh_proc func16
pacibsp
- .seh_pac_sign_return_address
+ .seh_pac_sign_lr
stp x29, lr, [sp, #-32]!
.seh_save_fplr_x 32
mov x29, sp
@@ -740,7 +740,7 @@ func16:
ldp x29, lr, [sp], #32
.seh_save_fplr_x 32
autibsp
- .seh_pac_sign_return_address
+ .seh_pac_sign_lr
.seh_endepilogue
ret
.seh_endproc
@@ -748,7 +748,7 @@ func16:
func17:
.seh_proc func17
pacibsp
- .seh_pac_sign_return_address
+ .seh_pac_sign_lr
stp x19, x20, [sp, #-16]!
.seh_save_r19r20_x 16
stp x29, lr, [sp, #-32]!
@@ -765,7 +765,7 @@ func17:
ldp x19, x20, [sp], #16
.seh_save_r19r20_x 16
autibsp
- .seh_pac_sign_return_address
+ .seh_pac_sign_lr
.seh_endepilogue
ret
.seh_endproc
@@ -773,7 +773,7 @@ func17:
func18:
.seh_proc func18
pacibsp
- .seh_pac_sign_return_address
+ .seh_pac_sign_lr
stp x19, x20, [sp, #-16]!
.seh_save_r19r20_x 16
sub sp, sp, #4080
@@ -798,7 +798,7 @@ func18:
ldp x19, x20, [sp], #16
.seh_save_r19r20_x 16
autibsp
- .seh_pac_sign_return_address
+ .seh_pac_sign_lr
.seh_endepilogue
ret
.seh_endproc
@@ -1075,7 +1075,7 @@ nonpacked14:
// Can't be packed; a signed return address can only be expressed if
// we save both x29 and lr on the stack.
pacibsp
- .seh_pac_sign_return_address
+ .seh_pac_sign_lr
str lr, [sp, #-32]!
.seh_save_reg_x lr, 32
.seh_endprologue
@@ -1084,7 +1084,7 @@ nonpacked14:
ldr lr, [sp], #32
.seh_save_reg_x lr, 32
autibsp
- .seh_pac_sign_return_address
+ .seh_pac_sign_lr
.seh_endepilogue
ret
.seh_endproc
@@ -1094,7 +1094,7 @@ nonpacked15:
// Can't be packed; a signed return address can only be expressed if
// we save both x29 and lr on the stack.
pacibsp
- .seh_pac_sign_return_address
+ .seh_pac_sign_lr
stp x19, x20, [sp, #-32]!
.seh_save_r19r20_x 32
stp x21, lr, [sp, #16]
@@ -1111,7 +1111,7 @@ nonpacked15:
ldp x19, x20, [sp], #32
.seh_save_r19r20_x 32
autibsp
- .seh_pac_sign_return_address
+ .seh_pac_sign_lr
.seh_endepilogue
ret
.seh_endproc
diff --git a/llvm/test/MC/AArch64/seh.s b/llvm/test/MC/AArch64/seh.s
index 23da04ea0ce47..81569bab378ad 100644
--- a/llvm/test/MC/AArch64/seh.s
+++ b/llvm/test/MC/AArch64/seh.s
@@ -153,7 +153,7 @@ func:
nop
.seh_clear_unwound_to_call
pacibsp
- .seh_pac_sign_return_address
+ .seh_pac_sign_lr
.seh_endprologue
nop
.seh_startepilogue
diff --git a/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp b/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
index d64534551ad40..88418e21b0e4e 100644
--- a/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
+++ b/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
@@ -172,7 +172,7 @@ const Decoder::RingEntry Decoder::Ring64[] = {
{0xff, 0xe9, 1, &Decoder::opcode_machine_frame},
{0xff, 0xea, 1, &Decoder::opcode_context},
{0xff, 0xec, 1, &Decoder::opcode_clear_unwound_to_call},
- {0xff, 0xfc, 1, &Decoder::opcode_pac_sign_return_address},
+ {0xff, 0xfc, 1, &Decoder::opcode_pac_sign_lr},
};
static void printRange(raw_ostream &OS, ListSeparator &LS, unsigned First,
@@ -977,9 +977,8 @@ bool Decoder::opcode_clear_unwound_to_call(const uint8_t *OC, unsigned &Offset,
return false;
}
-bool Decoder::opcode_pac_sign_return_address(const uint8_t *OC,
- unsigned &Offset, unsigned Length,
- bool Prologue) {
+bool Decoder::opcode_pac_sign_lr(const uint8_t *OC, unsigned &Offset,
+ unsigned Length, bool Prologue) {
if (Prologue)
SW.startLine() << format("0x%02x ; pacibsp\n", OC[Offset]);
else
diff --git a/llvm/tools/llvm-readobj/ARMWinEHPrinter.h b/llvm/tools/llvm-readobj/ARMWinEHPrinter.h
index 745a9cbb51cf6..0ffebe5834c48 100644
--- a/llvm/tools/llvm-readobj/ARMWinEHPrinter.h
+++ b/llvm/tools/llvm-readobj/ARMWinEHPrinter.h
@@ -131,8 +131,8 @@ class Decoder {
bool Prologue);
bool opcode_clear_unwound_to_call(const uint8_t *Opcodes, unsigned &Offset,
unsigned Length, bool Prologue);
- bool opcode_pac_sign_return_address(const uint8_t *Opcodes, unsigned &Offset,
- unsigned Length, bool Prologue);
+ bool opcode_pac_sign_lr(const uint8_t *Opcodes, unsigned &Offset,
+ unsigned Length, bool Prologue);
void decodeOpcodes(ArrayRef<uint8_t> Opcodes, unsigned Offset,
bool Prologue);
More information about the llvm-commits
mailing list