From: Adrian Prantl Date: Fri, 28 Jul 2017 22:46:20 +0000 (+0000) Subject: Remove the unused DBG_VALUE offset parameter from GlobalISel (NFC) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=30ac8d28e3b43d915f5dcd4a697a417f08584cc3;p=llvm Remove the unused DBG_VALUE offset parameter from GlobalISel (NFC) Followup to r309426. rdar://problem/33580047 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309449 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h b/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h index 40a24e4d2d7..722056a2dc0 100644 --- a/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h +++ b/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h @@ -174,11 +174,12 @@ public: const MDNode *Expr); /// Build and insert a DBG_VALUE instruction expressing the fact that the - /// associated \p Variable lives in memory at \p Reg + \p Offset (suitably - /// modified by \p Expr). - MachineInstrBuilder buildIndirectDbgValue(unsigned Reg, unsigned Offset, + /// associated \p Variable lives in memory at \p Reg (suitably modified by \p + /// Expr). + MachineInstrBuilder buildIndirectDbgValue(unsigned Reg, const MDNode *Variable, const MDNode *Expr); + /// Build and insert a DBG_VALUE instruction expressing the fact that the /// associated \p Variable lives in the stack slot specified by \p FI /// (suitably modified by \p Expr). @@ -187,7 +188,7 @@ public: /// Build and insert a DBG_VALUE instructions specifying that \p Variable is /// given by \p C (suitably modified by \p Expr). - MachineInstrBuilder buildConstDbgValue(const Constant &C, unsigned Offset, + MachineInstrBuilder buildConstDbgValue(const Constant &C, const MDNode *Variable, const MDNode *Expr); diff --git a/lib/CodeGen/GlobalISel/IRTranslator.cpp b/lib/CodeGen/GlobalISel/IRTranslator.cpp index 9c905848b4e..09870632c20 100644 --- a/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -682,11 +682,9 @@ bool IRTranslator::translateKnownIntrinsic(const CallInst &CI, Intrinsic::ID ID, if (!V) { // Currently the optimizer can produce this; insert an undef to // help debugging. Probably the optimizer should not do this. - MIRBuilder.buildIndirectDbgValue(0, 0, DI.getVariable(), - DI.getExpression()); + MIRBuilder.buildIndirectDbgValue(0, DI.getVariable(), DI.getExpression()); } else if (const auto *CI = dyn_cast(V)) { - MIRBuilder.buildConstDbgValue(*CI, 0, DI.getVariable(), - DI.getExpression()); + MIRBuilder.buildConstDbgValue(*CI, DI.getVariable(), DI.getExpression()); } else { unsigned Reg = getOrCreateVReg(*V); // FIXME: This does not handle register-indirect values at offset 0. The diff --git a/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp b/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp index 4636806c3f0..34a13d855cf 100644 --- a/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp +++ b/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp @@ -96,15 +96,16 @@ MachineInstrBuilder MachineIRBuilder::buildDirectDbgValue( .addMetadata(Expr); } -MachineInstrBuilder MachineIRBuilder::buildIndirectDbgValue( - unsigned Reg, unsigned Offset, const MDNode *Variable, const MDNode *Expr) { +MachineInstrBuilder +MachineIRBuilder::buildIndirectDbgValue(unsigned Reg, const MDNode *Variable, + const MDNode *Expr) { assert(isa(Variable) && "not a variable"); assert(cast(Expr)->isValid() && "not an expression"); assert(cast(Variable)->isValidLocationForIntrinsic(DL) && "Expected inlined-at fields to agree"); return buildInstr(TargetOpcode::DBG_VALUE) .addReg(Reg, RegState::Debug) - .addImm(Offset) + .addImm(0) .addMetadata(Variable) .addMetadata(Expr); } @@ -124,7 +125,6 @@ MachineInstrBuilder MachineIRBuilder::buildFIDbgValue(int FI, } MachineInstrBuilder MachineIRBuilder::buildConstDbgValue(const Constant &C, - unsigned Offset, const MDNode *Variable, const MDNode *Expr) { assert(isa(Variable) && "not a variable"); @@ -144,7 +144,7 @@ MachineInstrBuilder MachineIRBuilder::buildConstDbgValue(const Constant &C, MIB.addReg(0U); } - return MIB.addImm(Offset).addMetadata(Variable).addMetadata(Expr); + return MIB.addImm(0).addMetadata(Variable).addMetadata(Expr); } MachineInstrBuilder MachineIRBuilder::buildFrameIndex(unsigned Res, int Idx) {