[llvm-commits] [llvm] r80485 - /llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
Daniel Dunbar
daniel at zuster.org
Sat Aug 29 23:17:49 PDT 2009
Author: ddunbar
Date: Sun Aug 30 01:17:49 2009
New Revision: 80485
URL: http://llvm.org/viewvc/llvm-project?rev=80485&view=rev
Log:
llvm-mc/X86: Encode constant MCValue's correctly.
Modified:
llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=80485&r1=80484&r2=80485&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Sun Aug 30 01:17:49 2009
@@ -971,6 +971,12 @@
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;
More information about the llvm-commits
mailing list