本文整理汇总了C++中BranchInst::getOpcodeName方法的典型用法代码示例。如果您正苦于以下问题:C++ BranchInst::getOpcodeName方法的具体用法?C++ BranchInst::getOpcodeName怎么用?C++ BranchInst::getOpcodeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BranchInst
的用法示例。
在下文中一共展示了BranchInst::getOpcodeName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConvertSwitch
void MakeDispatcherPass::ConvertSwitch( Function& function )
{
BasicBlock* entryBB = &function.getEntryBlock();
std::cout << ":Processing " << function.getName().str() << std::endl;
for( Function::iterator i = function.begin(); i != function.end(); i++ )
{
BasicBlock* basicBlock = &*i;
Instruction* inst;
TerminatorInst* terminator = basicBlock->getTerminator();
assert( terminator && "Basic block is not well formed and has no terminator!" );
if( isa< BranchInst >( terminator ) )
{
// std::cout << "Branch Instruction !!!" << std::endl;
BranchInst* branchInst = dynamic_cast< BranchInst *>
(
basicBlock->getTerminator()
);
std::cout << "Branch Instruction, Opcode = " <<
branchInst->getOpcodeName();
if (branchInst->isConditional())
{
inst = dynamic_cast<Instruction *>(basicBlock->getTerminator());
std::cout << ", Is Conditional ";
// i->eraseFromParent();
}
else
{
std::cout << ", Is not conditionnal ";
}
// if (valbranch) // && !valbranch->getName().empty())
// {
// valbranch->getType()->dump();
// std::cout << valbranch->getName().str();
// }
// branchInst->eraseFromParent();
std::cout << std::endl;
// std::cout << branchInst->getCondition()->getName.str() << std::endl;
}
}
}