本文整理汇总了C++中IntrinsicInst::arg_operands方法的典型用法代码示例。如果您正苦于以下问题:C++ IntrinsicInst::arg_operands方法的具体用法?C++ IntrinsicInst::arg_operands怎么用?C++ IntrinsicInst::arg_operands使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IntrinsicInst
的用法示例。
在下文中一共展示了IntrinsicInst::arg_operands方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: escapeRegNode
/// Escape RegNode so that we can access it from child handlers. Find the call
/// to frameescape, if any, in the entry block and append RegNode to the list
/// of arguments.
int WinEHStatePass::escapeRegNode(Function &F) {
// Find the call to frameescape and extract its arguments.
IntrinsicInst *EscapeCall = nullptr;
for (Instruction &I : F.getEntryBlock()) {
IntrinsicInst *II = dyn_cast<IntrinsicInst>(&I);
if (II && II->getIntrinsicID() == Intrinsic::frameescape) {
EscapeCall = II;
break;
}
}
SmallVector<Value *, 8> Args;
if (EscapeCall) {
auto Ops = EscapeCall->arg_operands();
Args.append(Ops.begin(), Ops.end());
}
Args.push_back(RegNode);
// Replace the call (if it exists) with new one. Otherwise, insert at the end
// of the entry block.
IRBuilder<> Builder(&F.getEntryBlock(),
EscapeCall ? EscapeCall : F.getEntryBlock().end());
Builder.CreateCall(FrameEscape, Args);
if (EscapeCall)
EscapeCall->eraseFromParent();
return Args.size() - 1;
}