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


C++ FactMgr::find_dangling_global_ptrs方法代码示例

本文整理汇总了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;
}
开发者ID:ZhuJunhua1104,项目名称:csmith,代码行数:33,代码来源:Function.cpp

示例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;
}
开发者ID:ZhuJunhua1104,项目名称:csmith,代码行数:40,代码来源:Function.cpp


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