diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-02-10 04:47:08 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-02-10 04:47:08 +0000 |
commit | 5d5a1e13a129e18ee6031fe6354acd2ab4d39f37 (patch) | |
tree | d405b6583aeac3de3ed16f0dfc3fd037d22b2ed9 /lib/Target/X86/X86CodeEmitter.cpp | |
parent | 4c6e18aefebf88b5602458c186cd395e22011f0a (diff) |
MC: Switch MCFixup to just hold an MCExpr pointer instead of index into the
MCInst it came from.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95767 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86CodeEmitter.cpp')
-rw-r--r-- | lib/Target/X86/X86CodeEmitter.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Target/X86/X86CodeEmitter.cpp b/lib/Target/X86/X86CodeEmitter.cpp index ae035640df..f0bceb1483 100644 --- a/lib/Target/X86/X86CodeEmitter.cpp +++ b/lib/Target/X86/X86CodeEmitter.cpp @@ -878,12 +878,14 @@ void Emitter<CodeEmitter>::emitInstruction(const MachineInstr &MI, namespace { class MCSingleInstructionCodeEmitter : public MachineCodeEmitter { uint8_t Data[256]; + const MCInst *CurrentInst; SmallVectorImpl<MCFixup> *FixupList; public: - MCSingleInstructionCodeEmitter() { reset(0); } + MCSingleInstructionCodeEmitter() { reset(0, 0); } - void reset(SmallVectorImpl<MCFixup> *Fixups) { + void reset(const MCInst *Inst, SmallVectorImpl<MCFixup> *Fixups) { + CurrentInst = Inst; FixupList = Fixups; BufferBegin = Data; BufferEnd = array_endof(Data); @@ -915,7 +917,9 @@ public: OpIndex = MR.getJumpTableIndex(); } - FixupList->push_back(MCFixup::Create(Offset, OpIndex, + MCOperand Op = CurrentInst->getOperand(OpIndex); + assert(Op.isExpr() && "FIXME: Not yet implemented!"); + FixupList->push_back(MCFixup::Create(Offset, Op.getExpr(), MCFixupKind(FirstTargetFixupKind + Kind))); } virtual void setModuleInfo(MachineModuleInfo* Info) {} @@ -1163,7 +1167,7 @@ public: Instr->dump(); } - InstrEmitter->reset(&Fixups); + InstrEmitter->reset(&MI, &Fixups); if (OK) Emit->emitInstruction(*Instr, &Desc); OS << InstrEmitter->str(); |