From: Daniel Dunbar Date: Sun, 30 Aug 2009 06:17:49 +0000 (+0000) Subject: llvm-mc/X86: Encode constant MCValue's correctly. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=df65eafe5ef8bd4db97d1574f4b3823df2fb97bc;p=oota-llvm.git llvm-mc/X86: Encode constant MCValue's correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80485 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86CodeEmitter.cpp b/lib/Target/X86/X86CodeEmitter.cpp index d4d43af84fb..0c472a725bc 100644 --- a/lib/Target/X86/X86CodeEmitter.cpp +++ b/lib/Target/X86/X86CodeEmitter.cpp @@ -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;