llvm-mc/X86: Encode constant MCValue's correctly.
authorDaniel Dunbar <daniel@zuster.org>
Sun, 30 Aug 2009 06:17:49 +0000 (06:17 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sun, 30 Aug 2009 06:17:49 +0000 (06:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80485 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86CodeEmitter.cpp

index d4d43af84fbdbe261267c756706876490ac7dce3..0c472a725bcd21d1f45e0e9291dde1b39e86ce0e 100644 (file)
@@ -971,6 +971,12 @@ public:
     if (!Op.isMCValue())
       return false;
 
+    const MCValue &Val = Op.getMCValue();
+    if (Val.isAbsolute()) {
+      Instr->addOperand(MachineOperand::CreateImm(Val.getConstant()));
+      return true;
+    }
+
     // FIXME: Relocation / fixup.
     Instr->addOperand(MachineOperand::CreateImm(0));
     return true;