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


C++ BindingsTy::begin方法代码示例

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


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

示例1: iterBindings

void BasicStoreManager::iterBindings(Store store, BindingsHandler& f) {
    BindingsTy B = GetBindings(store);

    for (BindingsTy::iterator I=B.begin(), E=B.end(); I != E; ++I)
        f.HandleBinding(*this, store, I.getKey(), I.getData());

}
开发者ID:nishantcbse,项目名称:clamav-bytecode-compiler,代码行数:7,代码来源:BasicStore.cpp

示例2: print

void BasicStoreManager::print(Store store, llvm::raw_ostream& Out,
                              const char* nl, const char *sep) {

    BindingsTy B = GetBindings(store);
    Out << "Variables:" << nl;

    bool isFirst = true;

    for (BindingsTy::iterator I=B.begin(), E=B.end(); I != E; ++I) {
        if (isFirst)
            isFirst = false;
        else
            Out << nl;

        Out << ' ' << I.getKey() << " : " << I.getData();
    }
}
开发者ID:nishantcbse,项目名称:clamav-bytecode-compiler,代码行数:17,代码来源:BasicStore.cpp

示例3: RemoveDeadBindings

Store BasicStoreManager::RemoveDeadBindings(Store store, Stmt* Loc,
        SymbolReaper& SymReaper,
        llvm::SmallVectorImpl<const MemRegion*>& RegionRoots)
{
    BindingsTy B = GetBindings(store);
    typedef SVal::symbol_iterator symbol_iterator;

    // Iterate over the variable bindings.
    for (BindingsTy::iterator I=B.begin(), E=B.end(); I!=E ; ++I) {
        if (const VarRegion *VR = dyn_cast<VarRegion>(I.getKey())) {
            if (SymReaper.isLive(Loc, VR))
                RegionRoots.push_back(VR);
            else
                continue;
        }
        else if (isa<ObjCIvarRegion>(I.getKey())) {
            RegionRoots.push_back(I.getKey());
        }
        else
            continue;

        // Mark the bindings in the data as live.
        SVal X = I.getData();
        for (symbol_iterator SI=X.symbol_begin(), SE=X.symbol_end(); SI!=SE; ++SI)
            SymReaper.markLive(*SI);
    }

    // Scan for live variables and live symbols.
    llvm::SmallPtrSet<const MemRegion*, 10> Marked;

    while (!RegionRoots.empty()) {
        const MemRegion* MR = RegionRoots.back();
        RegionRoots.pop_back();

        while (MR) {
            if (const SymbolicRegion* SymR = dyn_cast<SymbolicRegion>(MR)) {
                SymReaper.markLive(SymR->getSymbol());
                break;
            }
            else if (isa<VarRegion>(MR) || isa<ObjCIvarRegion>(MR)) {
                if (Marked.count(MR))
                    break;

                Marked.insert(MR);
                SVal X = Retrieve(store, loc::MemRegionVal(MR));

                // FIXME: We need to handle symbols nested in region definitions.
                for (symbol_iterator SI=X.symbol_begin(),SE=X.symbol_end(); SI!=SE; ++SI)
                    SymReaper.markLive(*SI);

                if (!isa<loc::MemRegionVal>(X))
                    break;

                const loc::MemRegionVal& LVD = cast<loc::MemRegionVal>(X);
                RegionRoots.push_back(LVD.getRegion());
                break;
            }
            else if (const SubRegion* R = dyn_cast<SubRegion>(MR))
                MR = R->getSuperRegion();
            else
                break;
        }
    }

    // Remove dead variable bindings.
    for (BindingsTy::iterator I=B.begin(), E=B.end(); I!=E ; ++I) {
        const MemRegion* R = I.getKey();

        if (!Marked.count(R)) {
            store = Remove(store, ValMgr.makeLoc(R));
            SVal X = I.getData();

            for (symbol_iterator SI=X.symbol_begin(), SE=X.symbol_end(); SI!=SE; ++SI)
                SymReaper.maybeDead(*SI);
        }
    }

    return store;
}
开发者ID:nishantcbse,项目名称:clamav-bytecode-compiler,代码行数:79,代码来源:BasicStore.cpp


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