本文整理汇总了C++中Argument::use_end方法的典型用法代码示例。如果您正苦于以下问题:C++ Argument::use_end方法的具体用法?C++ Argument::use_end怎么用?C++ Argument::use_end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Argument
的用法示例。
在下文中一共展示了Argument::use_end方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runOnFunction
bool HexagonRemoveExtendArgs::runOnFunction(Function &F) {
unsigned Idx = 1;
for (Function::arg_iterator AI = F.arg_begin(), AE = F.arg_end(); AI != AE;
++AI, ++Idx) {
if (F.getAttributes().hasAttribute(Idx, Attribute::SExt)) {
Argument* Arg = AI;
if (!isa<PointerType>(Arg->getType())) {
for (Instruction::use_iterator UI = Arg->use_begin();
UI != Arg->use_end();) {
if (isa<SExtInst>(*UI)) {
Instruction* Use = cast<Instruction>(*UI);
SExtInst* SI = new SExtInst(Arg, Use->getType());
assert (EVT::getEVT(SI->getType()) ==
(EVT::getEVT(Use->getType())));
++UI;
Use->replaceAllUsesWith(SI);
Instruction* First = F.getEntryBlock().begin();
SI->insertBefore(First);
Use->eraseFromParent();
} else {
++UI;
}
}
}
}
}
return true;
}
示例2: getFunctionInvarInfo
//.........这里部分代码省略.........
operandIdxs[k] = ShadowInstIdx(INVALID_BLOCK_IDX, getShadowGlobalIndex(OpGV));
else
operandIdxs[k] = ShadowInstIdx();
incomingBBs[k] = BBIndices[PN->getIncomingBlock(k)];
}
SI.operandBBs = ImmutableArray<uint32_t>(incomingBBs, NumOperands);
}
else {
NumOperands = I->getNumOperands();
operandIdxs = new ShadowInstIdx[NumOperands];
for(unsigned k = 0, kend = I->getNumOperands(); k != kend; ++k) {
if(Instruction* OpI = dyn_cast<Instruction>(I->getOperand(k)))
operandIdxs[k] = ShadowInstIdx(BBIndices[OpI->getParent()], IIndices[OpI]);
else if(GlobalVariable* OpGV = const_cast<GlobalVariable*>(getGlobalVar(I->getOperand(k))))
operandIdxs[k] = ShadowInstIdx(INVALID_BLOCK_IDX, getShadowGlobalIndex(OpGV));
else if(BasicBlock* OpBB = dyn_cast<BasicBlock>(I->getOperand(k)))
operandIdxs[k] = ShadowInstIdx(BBIndices[OpBB], INVALID_INSTRUCTION_IDX);
else
operandIdxs[k] = ShadowInstIdx();
}
}
SI.operandIdxs = ImmutableArray<ShadowInstIdx>(operandIdxs, NumOperands);
// Get user indices:
unsigned nUsers = std::distance(I->use_begin(), I->use_end());
ShadowInstIdx* userIdxs = new ShadowInstIdx[nUsers];
Instruction::use_iterator UI;
unsigned k;
for(k = 0, UI = I->use_begin(); k != nUsers; ++k, ++UI) {
if(Instruction* UserI = dyn_cast<Instruction>(UI->getUser())) {
userIdxs[k] = ShadowInstIdx(BBIndices[UserI->getParent()], IIndices[UserI]);
}
else {
userIdxs[k] = ShadowInstIdx();
}
}
SI.userIdxs = ImmutableArray<ShadowInstIdx>(userIdxs, nUsers);
}
SBB.insts = ImmutableArray<ShadowInstructionInvar>(insts, BB->size());
}
RetInfo.BBs = ImmutableArray<ShadowBBInvar>(FShadowBlocks, TopOrderedBlocks.size());
// Get user info for arguments: