diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 6 |
2 files changed, 3 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 6c5aa966786..8820d21dd14 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -483,12 +483,8 @@ DIE *DwarfCompileUnit::constructVariableDIEImpl(const DbgVariable &DV, if (DVInsn->getOperand(0).isReg()) { const MachineOperand RegOp = DVInsn->getOperand(0); // If the second operand is an immediate, this is an indirect value. - if (DVInsn->getOperand(1).isImm()) { - MachineLocation Location(RegOp.getReg(), - DVInsn->getOperand(1).getImm()); - addVariableAddress(DV, *VariableDie, Location); - } else if (RegOp.getReg()) - addVariableAddress(DV, *VariableDie, MachineLocation(RegOp.getReg())); + MachineLocation Location(RegOp.getReg(), DVInsn->getOperand(1).isImm()); + addVariableAddress(DV, *VariableDie, Location); } else if (DVInsn->getOperand(0).isImm()) { // This variable is described by a single constant. // Check whether it has a DIExpression. diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 6e9afde0f28..b4bd470fe85 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -831,13 +831,9 @@ static DebugLocEntry::Value getDebugLocValue(const MachineInstr *MI) { assert(MI->getNumOperands() == 4); if (MI->getOperand(0).isReg()) { - MachineLocation MLoc; // If the second operand is an immediate, this is a // register-indirect address. - if (!MI->getOperand(1).isImm()) - MLoc.set(MI->getOperand(0).getReg()); - else - MLoc.set(MI->getOperand(0).getReg(), MI->getOperand(1).getImm()); + MachineLocation MLoc(MI->getOperand(0).getReg(), MI->getOperand(1).isImm()); return DebugLocEntry::Value(Expr, MLoc); } if (MI->getOperand(0).isImm()) |