Commit bbc8662d authored by Artem Dergachev's avatar Artem Dergachev
Browse files

[analyzer] NFC: Don't clean up range constraints twice.

Slightly improves static analysis speed.

Differential Revision: https://reviews.llvm.org/D70150
parent b29e5cdb
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -533,7 +533,8 @@ public:
  ConstraintManager &getConstraintManager() { return *ConstraintMgr; }
  SubEngine &getOwningEngine() { return *Eng; }

  ProgramStateRef removeDeadBindings(ProgramStateRef St,
  ProgramStateRef
  removeDeadBindingsFromEnvironmentAndStore(ProgramStateRef St,
                                            const StackFrameContext *LCtx,
                                            SymbolReaper &SymReaper);

+2 −1
Original line number Diff line number Diff line
@@ -728,7 +728,8 @@ void ExprEngine::removeDead(ExplodedNode *Pred, ExplodedNodeSet &Out,
  // Create a state in which dead bindings are removed from the environment
  // and the store. TODO: The function should just return new env and store,
  // not a new state.
  CleanedState = StateMgr.removeDeadBindings(CleanedState, SFC, SymReaper);
  CleanedState = StateMgr.removeDeadBindingsFromEnvironmentAndStore(
      CleanedState, SFC, SymReaper);

  // Process any special transfer function for dead symbols.
  // A tag to track convenience transitions, which can be removed at cleanup.
+4 −6
Original line number Diff line number Diff line
@@ -91,9 +91,8 @@ ProgramStateManager::~ProgramStateManager() {
    I->second.second(I->second.first);
}

ProgramStateRef
ProgramStateManager::removeDeadBindings(ProgramStateRef state,
                                   const StackFrameContext *LCtx,
ProgramStateRef ProgramStateManager::removeDeadBindingsFromEnvironmentAndStore(
    ProgramStateRef state, const StackFrameContext *LCtx,
    SymbolReaper &SymReaper) {

  // This code essentially performs a "mark-and-sweep" of the VariableBindings.
@@ -112,8 +111,7 @@ ProgramStateManager::removeDeadBindings(ProgramStateRef state,
  NewState.setStore(newStore);
  SymReaper.setReapedStore(newStore);

  ProgramStateRef Result = getPersistentState(NewState);
  return ConstraintMgr->removeDeadBindings(Result, SymReaper);
  return getPersistentState(NewState);
}

ProgramStateRef ProgramState::bindLoc(Loc LV,