mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user