Skip to content

Commit 304f9fc

Browse files
committed
[AArch64] Use helper class for emitting CFI instructions into MIR
1 parent ed9bcb5 commit 304f9fc

File tree

4 files changed

+83
-178
lines changed

4 files changed

+83
-178
lines changed

llvm/include/llvm/CodeGen/CFIInstBuilder.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,33 @@ class CFIInstBuilder {
6363
nullptr, TRI.getDwarfRegNum(Reg, IsEH)));
6464
}
6565

66-
void buildDefCFAOffset(int64_t Offset) const {
67-
insertCFIInst(MCCFIInstruction::cfiDefCfaOffset(nullptr, Offset));
66+
void buildDefCFAOffset(int64_t Offset, MCSymbol *Label = nullptr) const {
67+
insertCFIInst(MCCFIInstruction::cfiDefCfaOffset(Label, Offset));
6868
}
6969

7070
void buildOffset(MCRegister Reg, int64_t Offset) const {
7171
insertCFIInst(MCCFIInstruction::createOffset(
7272
nullptr, TRI.getDwarfRegNum(Reg, IsEH), Offset));
7373
}
7474

75+
void buildNegateRAState() const {
76+
insertCFIInst(MCCFIInstruction::createNegateRAState(nullptr));
77+
}
78+
79+
void buildNegateRAStateWithPC() const {
80+
insertCFIInst(MCCFIInstruction::createNegateRAStateWithPC(nullptr));
81+
}
82+
7583
void buildRestore(MCRegister Reg) const {
7684
insertCFIInst(MCCFIInstruction::createRestore(
7785
nullptr, TRI.getDwarfRegNum(Reg, IsEH)));
7886
}
7987

88+
void buildSameValue(MCRegister Reg) const {
89+
insertCFIInst(MCCFIInstruction::createSameValue(
90+
nullptr, TRI.getDwarfRegNum(Reg, IsEH)));
91+
}
92+
8093
void buildEscape(StringRef Bytes, StringRef Comment = "") const {
8194
insertCFIInst(
8295
MCCFIInstruction::createEscape(nullptr, Bytes, SMLoc(), Comment));

0 commit comments

Comments
 (0)