[llvm-dev] Unable to clone an instruction in AsmPrinter::EmitInstruction

Rail Shafigulin via llvm-dev llvm-dev at lists.llvm.org
Wed Dec 2 13:47:06 PST 2015

I'm working on a custom VLIW (we call it Escala). At the moment I'm trying
to implement EscalaAsmPrinter::EmitInstruction(const MachineInstr *MI). I'm
trying to clone an instruction and this produces and error. Below are the
code as well as error:

void EscalaAsmPrinter::EmitInstruction(const MachineInstr *MI) {
  const MachineFunction *MF = MI->getParent()->getParent();
  MachineInstr *CloneMI = MF->CloneMachineInstr(MI);

Here is the error:

lib/Target/Escala/EscalaAsmPrinter.cpp: In member function ‘virtual void
{anonymous}::EscalaAsmPrinter::EmitInstruction(const llvm::MachineInstr*)’:
lib/Target/Escala/EscalaAsmPrinter.cpp:379:51: error: no matching function
for call to ‘llvm::MachineFunction::CloneMachineInstr(const
llvm::MachineInstr*&) const’
   MachineInstr *CloneMI = MF->CloneMachineInstr(MI);

lib/Target/Escala/EscalaAsmPrinter.cpp:379:51: note: candidate is:
In file included from include/llvm/Target/TargetInstrInfo.h:19:0,
                 from lib/Target/Escala/EscalaInstrInfo.h:19,
                 from lib/Target/Escala/EscalaAsmPrinter.cpp:17:
include/llvm/CodeGen/MachineFunction.h:383:17: note: llvm::MachineInstr*
llvm::MachineFunction::CloneMachineInstr(const llvm::MachineInstr*) <near
   MachineInstr *CloneMachineInstr(const MachineInstr *Orig);

This just doesn't make sense to me. I'm missing something, but I can't
figure out what exactly. Would someone be able to shed some light on this?

Any help is really appreciated.

Rail Shafigulin
Software Engineer
Esencia Technologies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151202/51ee090e/attachment.html>

More information about the llvm-dev mailing list