本文整理汇总了C++中FactMgr::find_dangling_global_ptrs方法的典型用法代码示例。如果您正苦于以下问题:C++ FactMgr::find_dangling_global_ptrs方法的具体用法?C++ FactMgr::find_dangling_global_ptrs怎么用?C++ FactMgr::find_dangling_global_ptrs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FactMgr
的用法示例。
在下文中一共展示了FactMgr::find_dangling_global_ptrs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RandomReturnType
Function *
Function::make_first(void)
{
const Type *ty = RandomReturnType();
ERROR_GUARD(NULL);
Function *f = new Function(RandomFunctionName(), ty);
// dummy variable representing return variable, we don't care about the type, so use 0
string rvname = f->name + "_" + "rv";
CVQualifiers ret_qfer = CVQualifiers::random_qualifiers(ty);
ERROR_GUARD(NULL);
f->rv = Variable::CreateVariable(rvname, ty, NULL, &ret_qfer);
// create a fact manager for this function, with empty global facts
FactMgr* fm = new FactMgr(f);
FMList.push_back(fm);
ExtensionMgr::GenerateFirstParameterList(*f);
// No Parameter List
f->GenerateBody(CGContext::get_empty_context());
if (CGOptions::inline_function() && rnd_flipcoin(InlineFunctionProb))
f->is_inlined = true;
fm->setup_in_out_maps(true);
// update global facts to merged facts at all possible function exits
fm->global_facts = fm->map_facts_out[f->body];
f->body->add_back_return_facts(fm, fm->global_facts);
// collect info about global dangling pointers
fm->find_dangling_global_ptrs(f);
return f;
}
示例2: if
void
Function::make_builtin_function(const string &function_string)
{
vector<string> v;
StringUtils::split_string(function_string, v, ";");
if (v.size() == 4) {
if (!CGOptions::enabled_builtin(v[3]))
return;
}
else if (v.size() == 3) {
if (!CGOptions::enabled_builtin("generic"))
return;
}
else {
assert(0 && "Invalid builtin function format!");
}
const Type *ty = Type::get_type_from_string(v[0]);
Function *f = new Function(v[1], ty, /*is_builtin*/true);
// dummy variable representing return variable, we don't care about the type, so use 0
string rvname = f->name + "_" + "rv";
CVQualifiers ret_qfer = CVQualifiers::random_qualifiers(ty);
f->rv = Variable::CreateVariable(rvname, ty, NULL, &ret_qfer);
// create a fact manager for this function, with empty global facts
FactMgr* fm = new FactMgr(f);
FMList.push_back(fm);
GenerateParameterListFromString(*f, StringUtils::get_substring(v[2], '(', ')'));
f->GenerateBody(CGContext::get_empty_context());
// update global facts to merged facts at all possible function exits
fm->global_facts = fm->map_facts_out[f->body];
f->body->add_back_return_facts(fm, fm->global_facts);
// collect info about global dangling pointers
fm->find_dangling_global_ptrs(f);
++builtin_functions_cnt;
}