Use isReg(), isImm() and isFPImm().
authorDevang Patel <dpatel@apple.com>
Tue, 27 Apr 2010 22:04:41 +0000 (22:04 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 27 Apr 2010 22:04:41 +0000 (22:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102470 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index be65b82809219ef015147f862f06af86a53e5f23..eb5bba42db026726c1b6fa992939341f4d7c918d 100644 (file)
@@ -1537,17 +1537,15 @@ DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, DbgScope *Scope) {
     if (const MachineInstr *DbgValueInsn = DV->getDbgValue()) {
       if (DbgValueInsn->getNumOperands() == 3) {
         // FIXME : Handle getNumOperands != 3 
-        if (DbgValueInsn->getOperand(0).getType() 
-            == MachineOperand::MO_Register
-            && DbgValueInsn->getOperand(0).getReg()) {
+        if (DbgValueInsn->getOperand(0).isReg() &&
+            DbgValueInsn->getOperand(0).getReg()) {
           MachineLocation Location;
           Location.set(DbgValueInsn->getOperand(0).getReg());
           addAddress(VariableDie, dwarf::DW_AT_location, Location);
           if (MCSymbol *VS = DV->getDbgValueLabel())
             addLabel(VariableDie, dwarf::DW_AT_start_scope, dwarf::DW_FORM_addr,
                      VS);
-        } else if (DbgValueInsn->getOperand(0).getType() == 
-                   MachineOperand::MO_Immediate) {
+        } else if (DbgValueInsn->getOperand(0).isImm()) {
           DIEBlock *Block = new (DIEValueAllocator) DIEBlock();
           unsigned Imm = DbgValueInsn->getOperand(0).getImm();
           addUInt(Block, 0, dwarf::DW_FORM_udata, Imm);
@@ -1555,8 +1553,7 @@ DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, DbgScope *Scope) {
           if (MCSymbol *VS = DV->getDbgValueLabel())
             addLabel(VariableDie, dwarf::DW_AT_start_scope, dwarf::DW_FORM_addr,
                      VS);
-        } else if (DbgValueInsn->getOperand(0).getType() == 
-                   MachineOperand::MO_FPImmediate) {
+        } else if (DbgValueInsn->getOperand(0).isFPImm()) {
           DIEBlock *Block = new (DIEValueAllocator) DIEBlock();
           APFloat FPImm = DbgValueInsn->getOperand(0).getFPImm()->getValueAPF();
 
@@ -2083,8 +2080,7 @@ void DwarfDebug::collectVariableInfo() {
         continue;
 
       // Ignore Undef values.
-      if (MInsn->getOperand(0).getType() == MachineOperand::MO_Register
-          && !MInsn->getOperand(0).getReg())
+      if (MInsn->getOperand(0).isReg() && !MInsn->getOperand(0).getReg())
         continue;
 
       DIVariable DV(