本文整理汇总了C++中basicblock::const_iterator::getOpcode方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::getOpcode方法的具体用法?C++ const_iterator::getOpcode怎么用?C++ const_iterator::getOpcode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类basicblock::const_iterator
的用法示例。
在下文中一共展示了const_iterator::getOpcode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printBasicBlock
/**
* Print the given basic block.
*
* @param block the basic block
*/
void JVMWriter::printBasicBlock(const BasicBlock *block) {
printLabel(getLabelName(block));
if (trace) {
if (block->hasName()) {
std::string n = block->getName();
printTrc(n + ":");
}
}
for(BasicBlock::const_iterator i = block->begin(), e = block->end();
i != e; i++) {
instNum++;
if (trace)
printSimpleInstruction(".line", utostr(trcLineNum+1));
else if(debug >= 1)
printSimpleInstruction(".line", utostr(instNum));
if(debug >= 3 || trace) {
// print current instruction as comment
// note that this block of code significantly increases
// code generation time
std::string str;
raw_string_ostream ss(str); ss << *i;
ss.flush();
if (trace)
printTrc(str);
if (debug >= 3) {
std::string::size_type pos = 0;
while((pos = str.find("\n", pos)) != std::string::npos)
str.replace(pos++, 1, "\n;");
out << ';' << str << '\n';
}
}
if(i->getOpcode() == Instruction::PHI)
// don't handle phi instruction in current block
continue;
printInstruction(i);
if(i->getType() != Type::getVoidTy(block->getContext())
&& i->getOpcode() != Instruction::Invoke)
// instruction doesn't return anything, or is an invoke instruction
// which handles storing the return value itself
printValueStore(i);
}
}