[llvm-dev] Cloning a MachineInstr

Rail Shafigulin via llvm-dev llvm-dev at lists.llvm.org
Wed Dec 2 15:12:58 PST 2015


I'm trying to clone a MachineInstr in the AsmPrinter::EmitInstruction, Here
is the code:

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

The problem is that MF is a const and CloneMachineInstr expects a
non-const. Does anybody know if there is a way to create a copy of a given
MachineInstr?

Any help is appreciated.

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


More information about the llvm-dev mailing list