diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-31 08:08:38 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-31 08:08:38 +0000 |
commit | 8c2eebe4074ef218b30d94358f6b2e45c079605c (patch) | |
tree | e44c45883a8e8d40ba8b2529f467378cb0233538 /lib/Target/X86/X86CodeEmitter.cpp | |
parent | c18274ba9cabd5699452870daae3c2d9accecc37 (diff) |
llvm-mc: Switch MCInst to storing an MCExpr* instead of an MCValue.
Also, use MCInst::print instead of custom code in MCAsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80575 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86CodeEmitter.cpp')
-rw-r--r-- | lib/Target/X86/X86CodeEmitter.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Target/X86/X86CodeEmitter.cpp b/lib/Target/X86/X86CodeEmitter.cpp index 0c472a725b..7e2fd975c1 100644 --- a/lib/Target/X86/X86CodeEmitter.cpp +++ b/lib/Target/X86/X86CodeEmitter.cpp @@ -30,6 +30,7 @@ #include "llvm/Function.h" #include "llvm/ADT/Statistic.h" #include "llvm/MC/MCCodeEmitter.h" +#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCInst.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" @@ -968,12 +969,12 @@ public: Instr->addOperand(MachineOperand::CreateImm(Op.getImm())); return true; } - if (!Op.isMCValue()) + if (!Op.isExpr()) return false; - const MCValue &Val = Op.getMCValue(); - if (Val.isAbsolute()) { - Instr->addOperand(MachineOperand::CreateImm(Val.getConstant())); + const MCExpr *Expr = Op.getExpr(); + if (const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(Expr)) { + Instr->addOperand(MachineOperand::CreateImm(CE->getValue())); return true; } @@ -1036,9 +1037,8 @@ public: if (CurOp < NumOps) { // Hack to make branches work. if (!(Desc.TSFlags & X86II::ImmMask) && - MI.getOperand(0).isMCValue() && - MI.getOperand(0).getMCValue().getSymA() && - !MI.getOperand(0).getMCValue().getSymB()) + MI.getOperand(0).isExpr() && + isa<MCSymbolRefExpr>(MI.getOperand(0).getExpr())) Instr->addOperand(MachineOperand::CreateMBB(DummyMBB)); else OK &= AddImmToInstr(MI, Instr, CurOp); |