当前位置: 首页>>代码示例>>C++>>正文


C++ iterator::dump方法代码示例

本文整理汇总了C++中module::iterator::dump方法的典型用法代码示例。如果您正苦于以下问题:C++ iterator::dump方法的具体用法?C++ iterator::dump怎么用?C++ iterator::dump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在module::iterator的用法示例。


在下文中一共展示了iterator::dump方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: function_pointer_analysis

bool PathList::function_pointer_analysis()
{
	// add by wh
	// for add the global function pointer table command_table
	// to the CallGraph
	
	// get the global function table
	GlobalVariable *func_table = module->getGlobalVariable("command_table");	
	if (func_table && func_table->getNumUses() > 0) {
		errs()<<"[Global]: get command_table.\n";
	}
	else {
		errs()<<"[Global]: miss command_table or command_table isn't used.\n";
		return false;
	}
	// output the use list of func_table
	for (Value::use_iterator ui = func_table->use_begin(); ui != func_table->use_end(); ui++) {
		User *tmpuser = *ui;
//		int coutn = 0;
		if (tmpuser) {
			//errs() << tmpuser->getName() << '\n';
			//tmpuser->dump();
			// find the function which calls command_table in Module module
			for (Module::iterator mit = module->begin(); mit != module->end(); mit++) {
				Function *ff = &*mit;				
				if (ff) {
					for (inst_iterator fit = inst_begin(ff); fit != inst_end(ff); fit++) {
						Instruction *tmpfi = &*fit;
						// the function pointer table must be used in GetElementPtrInst
						if (isa<GetElementPtrInst>(tmpfi)) {
							//errs() << "tmpi has " << tmpfi->getNumOperands() << "operands.\n";
							//tmpfi->dump();
							//tmpfi->getOperand(0)->dump();
							extend_calledFunctionMap(tmpfi, tmpuser, func_table, ff);
						} 
					}
				} else {
					errs() << "Error: get function of module failed.\n";
					mit->dump();
					continue;
				}
			}
		} else {
			errs() << "get user failed.\n";
			continue;
		}
//		errs() << "++++++there are " << coutn << " lines call command_table in all.\n";
	}
	return true;
//	errs()<<"[Global]: "<<func_table->getName()<<"\n";
//	errs()<<"[Global]: type ID is "<<func_table->getType()->getTypeID()<<'\n';
}
开发者ID:yongjianchn,项目名称:klee,代码行数:52,代码来源:PathList.cpp


注:本文中的module::iterator::dump方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。