本文整理汇总了C++中BinaryOperator::getOpcodeName方法的典型用法代码示例。如果您正苦于以下问题:C++ BinaryOperator::getOpcodeName方法的具体用法?C++ BinaryOperator::getOpcodeName怎么用?C++ BinaryOperator::getOpcodeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryOperator
的用法示例。
在下文中一共展示了BinaryOperator::getOpcodeName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visitBinaryOperator
void AEFlowFunction::visitBinaryOperator(BinaryOperator &bo) {
errs() << "Enter Binary Operator\n";
map<Value*, Instruction*> node = Realin.back() -> node;
if(node.count(&bo) > 0) {
//While , For will trigger second and more visiting.
errs() << "AE Binary Operator, redefined\n";
AELatticeNode *ae = new AELatticeNode(*(Realin.back()));
out.push_back(ae);
return;
}
//continue process
Value* key = &bo;
Instruction* value;
bool found = false;
string opname = bo.getOpcodeName();
for(map<Value*, Instruction*>::iterator it = node.begin(); it != node.end(); ++it) {
Instruction* cache_instruction = it->second;
if(cache_instruction->isIdenticalToWhenDefined(&bo)) {
found = true;
value = cache_instruction;
break;
}
/*
* special case
* handle case like 1+2 / 2+1
*/
if(opname == "add") {
bo.swapOperands();
if(cache_instruction->isIdenticalToWhenDefined(&bo)) {
found = true;
value = cache_instruction;
bo.swapOperands();
break;
}
bo.swapOperands();
}
}
if(found) {
node[key] = value;
} else {
node[key] = dyn_cast<Instruction>(key);
}
AELatticeNode *ae = new AELatticeNode(false, false, node);
out.push_back(ae);
errs() << "Leave Binary Operator\n";
}