本文整理汇总了C++中basicblock::InstListType::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ InstListType::insert方法的具体用法?C++ InstListType::insert怎么用?C++ InstListType::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类basicblock::InstListType
的用法示例。
在下文中一共展示了InstListType::insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReplaceInstWithInst
/// ReplaceInstWithInst - Replace the instruction specified by BI with the
/// instruction specified by I. The original instruction is deleted and BI is
/// updated to point to the new instruction.
///
void llvm::ReplaceInstWithInst(BasicBlock::InstListType &BIL,
BasicBlock::iterator &BI, Instruction *I) {
assert(I->getParent() == 0 &&
"ReplaceInstWithInst: Instruction already inserted into basic block!");
// Insert the new instruction into the basic block...
BasicBlock::iterator New = BIL.insert(BI, I);
// Replace all uses of the old instruction, and delete it.
ReplaceInstWithValue(BIL, BI, I);
// Move BI back to point to the newly inserted instruction
BI = New;
}
示例2: ReplaceInstWithInst
void llvm::ReplaceInstWithInst(BasicBlock::InstListType &BIL,
BasicBlock::iterator &BI, Instruction *I) {
assert(I->getParent() == nullptr &&
"ReplaceInstWithInst: Instruction already inserted into basic block!");
// Copy debug location to newly added instruction, if it wasn't already set
// by the caller.
if (!I->getDebugLoc())
I->setDebugLoc(BI->getDebugLoc());
// Insert the new instruction into the basic block...
BasicBlock::iterator New = BIL.insert(BI, I);
// Replace all uses of the old instruction, and delete it.
ReplaceInstWithValue(BIL, BI, I);
// Move BI back to point to the newly inserted instruction
BI = New;
}