本文整理汇总了C++中machineinstr::mop_iterator::ChangeToImmediate方法的典型用法代码示例。如果您正苦于以下问题:C++ mop_iterator::ChangeToImmediate方法的具体用法?C++ mop_iterator::ChangeToImmediate怎么用?C++ mop_iterator::ChangeToImmediate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类machineinstr::mop_iterator
的用法示例。
在下文中一共展示了mop_iterator::ChangeToImmediate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runOnMachineFunction
bool WebAssemblyCallIndirectFixup::runOnMachineFunction(MachineFunction &MF) {
DEBUG(dbgs() << "********** Fixing up CALL_INDIRECTs **********\n"
<< MF.getName() << '\n');
bool Changed = false;
const WebAssemblyInstrInfo *TII =
MF.getSubtarget<WebAssemblySubtarget>().getInstrInfo();
for (MachineBasicBlock &MBB : MF) {
for (MachineInstr &MI : MBB) {
if (IsPseudoCallIndirect(MI)) {
DEBUG(dbgs() << "Found call_indirect: " << MI << '\n');
// Rewrite pseudo to non-pseudo
const MCInstrDesc &Desc = TII->get(GetNonPseudoCallIndirectOpcode(MI));
MI.setDesc(Desc);
// Rewrite argument order
auto Uses = MI.explicit_uses();
MachineInstr::mop_iterator it = Uses.begin();
const MachineOperand MO = *it;
// Set up the flags immediate, which currently has no defined flags
// so it's always zero.
it->ChangeToImmediate(0);
MI.addOperand(MF, MO);
DEBUG(dbgs() << " After transform: " << MI);
Changed = true;
}
}
}
DEBUG(dbgs() << "\nDone fixing up CALL_INDIRECTs\n\n");
return Changed;
}