Revert r218778 while investigating buldbot breakage.

"Move the complex address expression out of DIVariable and into an extra"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218782 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adrian Prantl
2014-10-01 18:10:54 +00:00
parent 076fd5dfc1
commit 10c4265675
257 changed files with 1379 additions and 1531 deletions

View File

@@ -244,22 +244,12 @@ public:
///
DebugLoc getDebugLoc() const { return debugLoc; }
/// \brief Return the debug variable referenced by
/// getDebugVariable() - Return the debug variable referenced by
/// this DBG_VALUE instruction.
DIVariable getDebugVariable() const {
assert(isDebugValue() && "not a DBG_VALUE");
DIVariable Var(getOperand(2).getMetadata());
assert(Var.Verify() && "not a DIVariable");
return Var;
}
/// \brief Return the complex address expression referenced by
/// this DBG_VALUE instruction.
DIExpression getDebugExpression() const {
assert(isDebugValue() && "not a DBG_VALUE");
DIExpression Expr(getOperand(3).getMetadata());
assert(Expr.Verify() && "not a DIExpression");
return Expr;
const MDNode *Var = getOperand(getNumOperands() - 1).getMetadata();
return DIVariable(Var);
}
/// emitError - Emit an error referring to the source location of this

View File

@@ -170,8 +170,6 @@ public:
const MachineInstrBuilder &addMetadata(const MDNode *MD) const {
MI->addOperand(*MF, MachineOperand::CreateMetadata(MD));
assert((MI->isDebugValue() ? MI->getDebugVariable().Verify() : true) &&
"first MDNode argument of a DBG_VALUE not a DIVariable");
return *this;
}
@@ -347,25 +345,24 @@ inline MachineInstrBuilder BuildMI(MachineBasicBlock *BB,
/// address. The convention is that a DBG_VALUE is indirect iff the
/// second operand is an immediate.
///
inline MachineInstrBuilder BuildMI(MachineFunction &MF, DebugLoc DL,
const MCInstrDesc &MCID, bool IsIndirect,
unsigned Reg, unsigned Offset,
const MDNode *Variable, const MDNode *Expr) {
assert(DIVariable(Variable).Verify() && "not a DIVariable");
assert(DIExpression(Expr).Verify() && "not a DIExpression");
inline MachineInstrBuilder BuildMI(MachineFunction &MF,
DebugLoc DL,
const MCInstrDesc &MCID,
bool IsIndirect,
unsigned Reg,
unsigned Offset,
const MDNode *MD) {
if (IsIndirect)
return BuildMI(MF, DL, MCID)
.addReg(Reg, RegState::Debug)
.addImm(Offset)
.addMetadata(Variable)
.addMetadata(Expr);
.addReg(Reg, RegState::Debug)
.addImm(Offset)
.addMetadata(MD);
else {
assert(Offset == 0 && "A direct address cannot have an offset.");
return BuildMI(MF, DL, MCID)
.addReg(Reg, RegState::Debug)
.addReg(0U, RegState::Debug)
.addMetadata(Variable)
.addMetadata(Expr);
.addReg(Reg, RegState::Debug)
.addReg(0U, RegState::Debug)
.addMetadata(MD);
}
}
@@ -374,15 +371,15 @@ inline MachineInstrBuilder BuildMI(MachineFunction &MF, DebugLoc DL,
/// address and inserts it at position I.
///
inline MachineInstrBuilder BuildMI(MachineBasicBlock &BB,
MachineBasicBlock::iterator I, DebugLoc DL,
const MCInstrDesc &MCID, bool IsIndirect,
unsigned Reg, unsigned Offset,
const MDNode *Variable, const MDNode *Expr) {
assert(DIVariable(Variable).Verify() && "not a DIVariable");
assert(DIExpression(Expr).Verify() && "not a DIExpression");
MachineBasicBlock::iterator I,
DebugLoc DL,
const MCInstrDesc &MCID,
bool IsIndirect,
unsigned Reg,
unsigned Offset,
const MDNode *MD) {
MachineFunction &MF = *BB.getParent();
MachineInstr *MI =
BuildMI(MF, DL, MCID, IsIndirect, Reg, Offset, Variable, Expr);
MachineInstr *MI = BuildMI(MF, DL, MCID, IsIndirect, Reg, Offset, MD);
BB.insert(I, MI);
return MachineInstrBuilder(MF, MI);
}

View File

@@ -166,7 +166,6 @@ public:
struct VariableDbgInfo {
TrackingVH<MDNode> Var;
TrackingVH<MDNode> Expr;
unsigned Slot;
DebugLoc Loc;
};
@@ -391,9 +390,8 @@ public:
/// setVariableDbgInfo - Collect information used to emit debugging
/// information of a variable.
void setVariableDbgInfo(MDNode *Var, MDNode *Expr, unsigned Slot,
DebugLoc Loc) {
VariableDbgInfo Info = {Var, Expr, Slot, Loc};
void setVariableDbgInfo(MDNode *N, unsigned Slot, DebugLoc Loc) {
VariableDbgInfo Info = { N, Slot, Loc };
VariableDbgInfos.push_back(std::move(Info));
}

View File

@@ -984,18 +984,15 @@ public:
/// getDbgValue - Creates a SDDbgValue node.
///
/// SDNode
SDDbgValue *getDbgValue(MDNode *Var, MDNode *Expr, SDNode *N, unsigned R,
bool IsIndirect, uint64_t Off, DebugLoc DL,
unsigned O);
/// Constant
SDDbgValue *getConstantDbgValue(MDNode *Var, MDNode *Expr, const Value *C,
uint64_t Off, DebugLoc DL, unsigned O);
/// FrameIndex
SDDbgValue *getFrameIndexDbgValue(MDNode *Var, MDNode *Expr, unsigned FI,
uint64_t Off, DebugLoc DL, unsigned O);
SDDbgValue *getDbgValue(MDNode *MDPtr, SDNode *N, unsigned R,
bool IsIndirect, uint64_t Off,
DebugLoc DL, unsigned O);
/// Constant.
SDDbgValue *getConstantDbgValue(MDNode *MDPtr, const Value *C, uint64_t Off,
DebugLoc DL, unsigned O);
/// Frame index.
SDDbgValue *getFrameIndexDbgValue(MDNode *MDPtr, unsigned FI, uint64_t Off,
DebugLoc DL, unsigned O);
/// RemoveDeadNode - Remove the specified node from the system. If any of its
/// operands then becomes dead, remove them as well. Inform UpdateListener