Skip to content

[CodeGen] Add another method to CFIInstBuilder #136270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions llvm/include/llvm/CodeGen/CFIInstBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ class CFIInstBuilder {
insertCFIInst(MCCFIInstruction::cfiDefCfaOffset(nullptr, Offset));
}

void buildAdjustCFAOffset(int64_t Adjustment) const {
insertCFIInst(MCCFIInstruction::createAdjustCfaOffset(nullptr, Adjustment));
}

void buildOffset(MCRegister Reg, int64_t Offset) const {
insertCFIInst(MCCFIInstruction::createOffset(
nullptr, TRI.getDwarfRegNum(Reg, IsEH), Offset));
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Target/MSP430/MSP430FrameLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "MSP430InstrInfo.h"
#include "MSP430MachineFunctionInfo.h"
#include "MSP430Subtarget.h"
#include "llvm/CodeGen/CFIInstBuilder.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
Expand Down Expand Up @@ -406,9 +407,8 @@ MachineBasicBlock::iterator MSP430FrameLowering::eliminateCallFramePseudoInstr(
.addReg(MSP430::SP)
.addImm(CalleeAmt);
if (!hasFP(MF)) {
DebugLoc DL = I->getDebugLoc();
BuildCFI(MBB, I, DL,
MCCFIInstruction::createAdjustCfaOffset(nullptr, CalleeAmt));
CFIInstBuilder(MBB, I, MachineInstr::NoFlags)
.buildAdjustCFAOffset(CalleeAmt);
}
// The SRW implicit def is dead.
New->getOperand(3).setIsDead();
Expand Down
Loading