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


C++ ProgramStateRef::getGDM方法代码示例

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


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

示例1: VisitTerminator

PathDiagnosticPiece *ConditionBRVisitor::VisitNodeImpl(const ExplodedNode *N,
                                                       const ExplodedNode *Prev,
                                                       BugReporterContext &BRC,
                                                       BugReport &BR) {
  
  const ProgramPoint &progPoint = N->getLocation();

  ProgramStateRef CurrentState = N->getState();
  ProgramStateRef PrevState = Prev->getState();
  
  // Compare the GDMs of the state, because that is where constraints
  // are managed.  Note that ensure that we only look at nodes that
  // were generated by the analyzer engine proper, not checkers.
  if (CurrentState->getGDM().getRoot() ==
      PrevState->getGDM().getRoot())
    return 0;
  
  // If an assumption was made on a branch, it should be caught
  // here by looking at the state transition.
  if (const BlockEdge *BE = dyn_cast<BlockEdge>(&progPoint)) {
    const CFGBlock *srcBlk = BE->getSrc();    
    if (const Stmt *term = srcBlk->getTerminator())
      return VisitTerminator(term, N, srcBlk, BE->getDst(), BR, BRC);
    return 0;
  }
  
  if (const PostStmt *PS = dyn_cast<PostStmt>(&progPoint)) {
    // FIXME: Assuming that BugReporter is a GRBugReporter is a layering
    // violation.
    const std::pair<const ProgramPointTag *, const ProgramPointTag *> &tags =      
      cast<GRBugReporter>(BRC.getBugReporter()).
        getEngine().getEagerlyAssumeTags();

    const ProgramPointTag *tag = PS->getTag();
    if (tag == tags.first)
      return VisitTrueTest(cast<Expr>(PS->getStmt()), true,
                           BRC, BR, N);
    if (tag == tags.second)
      return VisitTrueTest(cast<Expr>(PS->getStmt()), false,
                           BRC, BR, N);
                           
    return 0;
  }
    
  return 0;
}
开发者ID:DevO2012,项目名称:clang-with-ms-abi-support,代码行数:46,代码来源:BugReporterVisitors.cpp

示例2: removeGDM

ProgramStateRef ProgramStateManager::removeGDM(ProgramStateRef state, void *Key) {
    ProgramState::GenericDataMap OldM = state->getGDM();
    ProgramState::GenericDataMap NewM = GDMFactory.remove(OldM, Key);

    if (NewM == OldM)
        return state;

    ProgramState NewState = *state;
    NewState.GDM = NewM;
    return getPersistentState(NewState);
}
开发者ID:tomtor,项目名称:freebsd,代码行数:11,代码来源:ProgramState.cpp

示例3: addGDM

ProgramStateRef ProgramStateManager::addGDM(ProgramStateRef St, void *Key, void *Data) {
    ProgramState::GenericDataMap M1 = St->getGDM();
    ProgramState::GenericDataMap M2 = GDMFactory.add(M1, Key, Data);

    if (M1 == M2)
        return St;

    ProgramState NewSt = *St;
    NewSt.GDM = M2;
    return getPersistentState(NewSt);
}
开发者ID:tomtor,项目名称:freebsd,代码行数:11,代码来源:ProgramState.cpp


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