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


C++ BindingsTy类代码示例

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


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

示例1: GetBindings

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: getInitialStackFrameContents

void CXXInstanceCall::getInitialStackFrameContents(
                                            const StackFrameContext *CalleeCtx,
                                            BindingsTy &Bindings) const {
  AnyFunctionCall::getInitialStackFrameContents(CalleeCtx, Bindings);

  // Handle the binding of 'this' in the new stack frame.
  SVal ThisVal = getCXXThisVal();
  if (!ThisVal.isUnknown()) {
    ProgramStateManager &StateMgr = getState()->getStateManager();
    SValBuilder &SVB = StateMgr.getSValBuilder();

    const CXXMethodDecl *MD = cast<CXXMethodDecl>(CalleeCtx->getDecl());
    Loc ThisLoc = SVB.getCXXThis(MD, CalleeCtx);

    // If we devirtualized to a different member function, we need to make sure
    // we have the proper layering of CXXBaseObjectRegions.
    if (MD->getCanonicalDecl() != getDecl()->getCanonicalDecl()) {
      ASTContext &Ctx = SVB.getContext();
      const CXXRecordDecl *Class = MD->getParent();
      QualType Ty = Ctx.getPointerType(Ctx.getRecordType(Class));

      // FIXME: CallEvent maybe shouldn't be directly accessing StoreManager.
      bool Failed;
      ThisVal = StateMgr.getStoreManager().evalDynamicCast(ThisVal, Ty, Failed);
      assert(!Failed && "Calling an incorrectly devirtualized method");
    }

    if (!ThisVal.isUnknown())
      Bindings.push_back(std::make_pair(ThisLoc, ThisVal));
  }
}
开发者ID:apfeiffer1,项目名称:clang,代码行数:31,代码来源:CallEvent.cpp

示例3: UnknownVal

SVal BasicStoreManager::Retrieve(Store store, Loc loc, QualType T) {
    if (isa<UnknownVal>(loc))
        return UnknownVal();

    assert(!isa<UndefinedVal>(loc));

    switch (loc.getSubKind()) {

    case loc::MemRegionKind: {
        const MemRegion* R = cast<loc::MemRegionVal>(loc).getRegion();

        if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R)))
            return UnknownVal();

        BindingsTy B = GetBindings(store);
        BindingsTy::data_type *Val = B.lookup(R);
        const TypedRegion *TR = cast<TypedRegion>(R);

        if (Val)
            return CastRetrievedVal(*Val, TR, T);

        SVal V = LazyRetrieve(store, TR);
        return V.isUnknownOrUndef() ? V : CastRetrievedVal(V, TR, T);
    }

    case loc::ConcreteIntKind:
        // Some clients may call GetSVal with such an option simply because
        // they are doing a quick scan through their Locs (potentially to
        // invalidate their bindings).  Just return Undefined.
        return UndefinedVal();

    default:
        assert (false && "Invalid Loc.");
        break;
    }

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

示例4: getInitialStackFrameContents

void BlockCall::getInitialStackFrameContents(const StackFrameContext *CalleeCtx,
                                             BindingsTy &Bindings) const {
  SValBuilder &SVB = getState()->getStateManager().getSValBuilder();
  ArrayRef<ParmVarDecl*> Params;
  if (isConversionFromLambda()) {
    auto *LambdaOperatorDecl = cast<CXXMethodDecl>(CalleeCtx->getDecl());
    Params = LambdaOperatorDecl->parameters();

    // For blocks converted from a C++ lambda, the callee declaration is the
    // operator() method on the lambda so we bind "this" to
    // the lambda captured by the block.
    const VarRegion *CapturedLambdaRegion = getRegionStoringCapturedLambda();
    SVal ThisVal = loc::MemRegionVal(CapturedLambdaRegion);
    Loc ThisLoc = SVB.getCXXThis(LambdaOperatorDecl, CalleeCtx);
    Bindings.push_back(std::make_pair(ThisLoc, ThisVal));
  } else {
    Params = cast<BlockDecl>(CalleeCtx->getDecl())->parameters();
  }

  addParameterValuesToBindings(CalleeCtx, Bindings, SVB, *this,
                               Params);
}
开发者ID:2asoft,项目名称:freebsd,代码行数:22,代码来源:CallEvent.cpp


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