mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 08:26:29 +00:00
Use helper function instead of manually constructing DBG_VALUEs (NFC)
rdar://problem/33580047 llvm-svn: 309757
This commit is contained in:
parent
d2e6077460
commit
30bf1f68b0
@ -83,17 +83,15 @@ MachineInstrBuilder MachineIRBuilder::insertInstr(MachineInstrBuilder MIB) {
|
||||
return MIB;
|
||||
}
|
||||
|
||||
MachineInstrBuilder MachineIRBuilder::buildDirectDbgValue(
|
||||
unsigned Reg, const MDNode *Variable, const MDNode *Expr) {
|
||||
MachineInstrBuilder
|
||||
MachineIRBuilder::buildDirectDbgValue(unsigned Reg, const MDNode *Variable,
|
||||
const MDNode *Expr) {
|
||||
assert(isa<DILocalVariable>(Variable) && "not a variable");
|
||||
assert(cast<DIExpression>(Expr)->isValid() && "not an expression");
|
||||
assert(cast<DILocalVariable>(Variable)->isValidLocationForIntrinsic(DL) &&
|
||||
"Expected inlined-at fields to agree");
|
||||
return buildInstr(TargetOpcode::DBG_VALUE)
|
||||
.addReg(Reg, RegState::Debug)
|
||||
.addReg(0, RegState::Debug)
|
||||
.addMetadata(Variable)
|
||||
.addMetadata(Expr);
|
||||
return insertInstr(BuildMI(getMF(), DL, getTII().get(TargetOpcode::DBG_VALUE),
|
||||
/*IsIndirect*/ false, Reg, Variable, Expr));
|
||||
}
|
||||
|
||||
MachineInstrBuilder
|
||||
@ -103,11 +101,8 @@ MachineIRBuilder::buildIndirectDbgValue(unsigned Reg, const MDNode *Variable,
|
||||
assert(cast<DIExpression>(Expr)->isValid() && "not an expression");
|
||||
assert(cast<DILocalVariable>(Variable)->isValidLocationForIntrinsic(DL) &&
|
||||
"Expected inlined-at fields to agree");
|
||||
return buildInstr(TargetOpcode::DBG_VALUE)
|
||||
.addReg(Reg, RegState::Debug)
|
||||
.addImm(0)
|
||||
.addMetadata(Variable)
|
||||
.addMetadata(Expr);
|
||||
return insertInstr(BuildMI(getMF(), DL, getTII().get(TargetOpcode::DBG_VALUE),
|
||||
/*IsIndirect*/ true, Reg, Variable, Expr));
|
||||
}
|
||||
|
||||
MachineInstrBuilder MachineIRBuilder::buildFIDbgValue(int FI,
|
||||
|
@ -1212,11 +1212,8 @@ bool FastISel::selectIntrinsicCall(const IntrinsicInst *II) {
|
||||
if (!V) {
|
||||
// Currently the optimizer can produce this; insert an undef to
|
||||
// help debugging. Probably the optimizer should not do this.
|
||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, II)
|
||||
.addReg(0U)
|
||||
.addImm(0U)
|
||||
.addMetadata(DI->getVariable())
|
||||
.addMetadata(DI->getExpression());
|
||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, II, false, 0U,
|
||||
DI->getVariable(), DI->getExpression());
|
||||
} else if (const auto *CI = dyn_cast<ConstantInt>(V)) {
|
||||
if (CI->getBitWidth() > 64)
|
||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, II)
|
||||
|
Loading…
Reference in New Issue
Block a user