本文整理汇总了C++中GEPOperator::getNumOperands方法的典型用法代码示例。如果您正苦于以下问题:C++ GEPOperator::getNumOperands方法的具体用法?C++ GEPOperator::getNumOperands怎么用?C++ GEPOperator::getNumOperands使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GEPOperator
的用法示例。
在下文中一共展示了GEPOperator::getNumOperands方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseName
string esp::parseName(Value *value){
// has existed
if(names.find(value) != names.end())
return names[value];
string name = "";
Value *current = value;
/*
bool continueFlag = true;
do{
if(isa<Instruction > (current)){
Instruction* inst = dyn_cast<Instruction>(current);
unsigned op = inst->getOpcode();
switch(op){
case Instruction::Ret :{
break;
}
case Instruction::Br :{
break;
}
case Instruction::Switch :{
break;
}
case Instruction::Call :{
CallInst *callinst = (CallInst*) current;
if (((CallInst*) current)->getCalledFunction() != NULL) {
name += string("@")+((CallInst*) current)->getCalledFunction()->getNameStr() + "(";
} else {
name += string("@[funcPTR](");
name += ((CallInst*) current)->getCalledValue()->getNameStr();
}
for (unsigned i = 1; i < callinst->getNumOperands(); i++) {
name += esp::parseName(callinst->getOperand(i));
}
name += string(")");
continueFlag = false;
break;
}
case Instruction::PHI :{
name += string("PHI[");
name += current->getNameStr();
PHINode *phi = (PHINode*) current;
for (unsigned i = 0; i < phi->getNumIncomingValues(); i++) {
Value *incoming = phi->getIncomingValue(i);
if (i != 0) name += ",";
if (!hasLoop(incoming)) {
if (!incoming->hasName()) {
name += esp::parseName(incoming);
} else {
name += incoming->getNameStr();
}
}
}
name += std::string("]");
continueFlag = false;
break;
}
case Instruction::Select :{
break;
}
case Instruction::Add :{
name += "+";
name += parseBinaryOpName(inst);
break;
}
case Instruction::Sub :{
name += "-";
name += parseBinaryOpName(inst);
break;
}
case Instruction::Mul :{
name += "*";
name += parseBinaryOpName(inst);
break;
}
case Instruction::UDiv :{
name += "/";
name += parseBinaryOpName(inst);
break;
}
case Instruction::SDiv :{
name += "//";
name += parseBinaryOpName(inst);
break;
//.........这里部分代码省略.........