diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/StaticAnalyzer/Checker.cpp | 2 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Checkers/ExprEngine.cpp | 31 | ||||
-rw-r--r-- | lib/StaticAnalyzer/CoreEngine.cpp | 12 |
3 files changed, 21 insertions, 24 deletions
diff --git a/lib/StaticAnalyzer/Checker.cpp b/lib/StaticAnalyzer/Checker.cpp index 2ee910f8df..c5112339c5 100644 --- a/lib/StaticAnalyzer/Checker.cpp +++ b/lib/StaticAnalyzer/Checker.cpp @@ -24,7 +24,7 @@ CheckerContext::~CheckerContext() { // without actually generated a new node. We also shouldn't autotransition // if we are building sinks or we generated a node and decided to not // add it as a transition. - if (Dst.size() == size && !B.BuildSinks && !B.HasGeneratedNode) { + if (Dst.size() == size && !B.BuildSinks && !B.hasGeneratedNode) { if (ST && ST != B.GetState(Pred)) { static int autoTransitionTag = 0; addTransition(ST, &autoTransitionTag); diff --git a/lib/StaticAnalyzer/Checkers/ExprEngine.cpp b/lib/StaticAnalyzer/Checkers/ExprEngine.cpp index e912273e1a..1577cbee31 100644 --- a/lib/StaticAnalyzer/Checkers/ExprEngine.cpp +++ b/lib/StaticAnalyzer/Checkers/ExprEngine.cpp @@ -541,7 +541,7 @@ void ExprEngine::ProcessStmt(const CFGStmt S, StmtNodeBuilder& builder) { "Error evaluating statement"); Builder = &builder; - EntryNode = builder.getBasePredecessor(); + EntryNode = builder.getPredecessor(); // Create the cleaned state. const LocationContext *LC = EntryNode->getLocationContext(); @@ -569,7 +569,7 @@ void ExprEngine::ProcessStmt(const CFGStmt S, StmtNodeBuilder& builder) { Tmp.Add(EntryNode); else { SaveAndRestore<bool> OldSink(Builder->BuildSinks); - SaveOr OldHasGen(Builder->HasGeneratedNode); + SaveOr OldHasGen(Builder->hasGeneratedNode); SaveAndRestore<bool> OldPurgeDeadSymbols(Builder->PurgingDeadSymbols); Builder->PurgingDeadSymbols = true; @@ -604,7 +604,7 @@ void ExprEngine::ProcessStmt(const CFGStmt S, StmtNodeBuilder& builder) { } } - if (!Builder->BuildSinks && !Builder->HasGeneratedNode) + if (!Builder->BuildSinks && !Builder->hasGeneratedNode) Tmp.Add(EntryNode); } @@ -623,7 +623,7 @@ void ExprEngine::ProcessStmt(const CFGStmt S, StmtNodeBuilder& builder) { // a node with a "cleaned" state; CoreEngine will actually handle // auto-transitions for other cases. if (Dst.size() == 1 && *Dst.begin() == EntryNode - && !Builder->HasGeneratedNode && !HasAutoGenerated) { + && !Builder->hasGeneratedNode && !HasAutoGenerated) { HasAutoGenerated = true; builder.generateNode(currentStmt, GetState(EntryNode), *I); } @@ -643,7 +643,7 @@ void ExprEngine::ProcessInitializer(const CFGInitializer Init, // We don't set EntryNode and currentStmt. And we don't clean up state. const CXXCtorInitializer *BMI = Init.getInitializer(); - ExplodedNode *Pred = builder.getBasePredecessor(); + ExplodedNode *Pred = builder.getPredecessor(); const LocationContext *LC = Pred->getLocationContext(); if (BMI->isAnyMemberInitializer()) { @@ -699,7 +699,7 @@ void ExprEngine::ProcessImplicitDtor(const CFGImplicitDtor D, void ExprEngine::ProcessAutomaticObjDtor(const CFGAutomaticObjDtor dtor, StmtNodeBuilder &builder) { - ExplodedNode *pred = builder.getBasePredecessor(); + ExplodedNode *pred = builder.getPredecessor(); const GRState *state = pred->getState(); const VarDecl *varDecl = dtor.getVarDecl(); @@ -1754,7 +1754,6 @@ void ExprEngine::evalStore(ExplodedNodeSet& Dst, const Expr *AssignE, SaveAndRestore<ProgramPoint::Kind> OldSPointKind(Builder->PointKind, ProgramPoint::PostStoreKind); - SaveAndRestore<const void*> OldTag(Builder->Tag, tag); // Proceed with the store. We use AssignE as the anchor for the PostStore // ProgramPoint if it is non-NULL, and LocationE otherwise. @@ -1811,7 +1810,6 @@ void ExprEngine::evalLoadCommon(ExplodedNodeSet& Dst, const Expr *Ex, assert(!location.isUndef()); SaveAndRestore<ProgramPoint::Kind> OldSPointKind(Builder->PointKind); - SaveAndRestore<const void*> OldTag(Builder->Tag); // Proceed with the load. for (ExplodedNodeSet::iterator NI=Tmp.begin(), NE=Tmp.end(); NI!=NE; ++NI) { @@ -1971,7 +1969,7 @@ void ExprEngine::VisitCall(const CallExpr* CE, ExplodedNode* Pred, // Dispatch to the plug-in transfer function. unsigned oldSize = DstTmp3.size(); - SaveOr OldHasGen(Builder->HasGeneratedNode); + SaveOr OldHasGen(Builder->hasGeneratedNode); Pred = *DI_Checker; // Dispatch to transfer function logic to handle the call itself. @@ -1982,7 +1980,7 @@ void ExprEngine::VisitCall(const CallExpr* CE, ExplodedNode* Pred, // Handle the case where no nodes where generated. Auto-generate that // contains the updated state if we aren't generating sinks. if (!Builder->BuildSinks && DstTmp3.size() == oldSize && - !Builder->HasGeneratedNode) + !Builder->hasGeneratedNode) MakeNode(DstTmp3, CE, Pred, state); } } @@ -2260,7 +2258,7 @@ void ExprEngine::VisitObjCMessageExpr(const ObjCMessageExpr* ME, bool RaisesException = false; unsigned oldSize = dstEval.size(); SaveAndRestore<bool> OldSink(Builder->BuildSinks); - SaveOr OldHasGen(Builder->HasGeneratedNode); + SaveOr OldHasGen(Builder->hasGeneratedNode); if (const Expr *Receiver = ME->getInstanceReceiver()) { const GRState *state = GetState(Pred); @@ -2344,7 +2342,7 @@ void ExprEngine::VisitObjCMessageExpr(const ObjCMessageExpr* ME, // Handle the case where no nodes where generated. Auto-generate that // contains the updated state if we aren't generating sinks. if (!Builder->BuildSinks && dstEval.size() == oldSize && - !Builder->HasGeneratedNode) + !Builder->hasGeneratedNode) MakeNode(dstEval, ME, Pred, GetState(Pred)); } @@ -3082,11 +3080,10 @@ void ExprEngine::VisitReturnStmt(const ReturnStmt *RS, ExplodedNode *Pred, // Record the returned expression in the state. It will be used in // processCallExit to bind the return value to the call expr. { - static int Tag = 0; - SaveAndRestore<const void *> OldTag(Builder->Tag, &Tag); + static int tag = 0; const GRState *state = GetState(Pred); state = state->set<ReturnExpr>(RetE); - Pred = Builder->generateNode(RetE, state, Pred); + Pred = Builder->generateNode(RetE, state, Pred, &tag); } // We may get a NULL Pred because we generated a cached node. if (Pred) @@ -3108,13 +3105,13 @@ void ExprEngine::VisitReturnStmt(const ReturnStmt *RS, ExplodedNode *Pred, unsigned size = Dst.size(); SaveAndRestore<bool> OldSink(Builder->BuildSinks); - SaveOr OldHasGen(Builder->HasGeneratedNode); + SaveOr OldHasGen(Builder->hasGeneratedNode); getTF().evalReturn(Dst, *this, *Builder, RS, Pred); // Handle the case where no nodes where generated. if (!Builder->BuildSinks && Dst.size() == size && - !Builder->HasGeneratedNode) + !Builder->hasGeneratedNode) MakeNode(Dst, RS, Pred, GetState(Pred)); } } diff --git a/lib/StaticAnalyzer/CoreEngine.cpp b/lib/StaticAnalyzer/CoreEngine.cpp index 9ccc4472f4..13cca35aac 100644 --- a/lib/StaticAnalyzer/CoreEngine.cpp +++ b/lib/StaticAnalyzer/CoreEngine.cpp @@ -295,7 +295,7 @@ void CoreEngine::HandleBlockEdge(const BlockEdge& L, ExplodedNode* Pred) { SubEng.processCFGBlockEntrance(dstNodes, nodeBuilder); if (dstNodes.empty()) { - if (!nodeBuilder.hasGeneratedNode()) { + if (!nodeBuilder.hasGeneratedNode) { // Auto-generate a node and enqueue it to the worklist. generateNode(BE, Pred->State, Pred); } @@ -468,7 +468,7 @@ GenericNodeBuilderImpl::generateNodeImpl(const GRState *state, ProgramPoint programPoint, bool asSink) { - HasGeneratedNode = true; + hasGeneratedNode = true; bool isNew; ExplodedNode *node = engine.getGraph().getNode(programPoint, state, &isNew); if (pred) @@ -487,7 +487,7 @@ StmtNodeBuilder::StmtNodeBuilder(const CFGBlock* b, unsigned idx, ExplodedNode* N, CoreEngine* e, GRStateManager &mgr) : Eng(*e), B(*b), Idx(idx), Pred(N), Mgr(mgr), - PurgingDeadSymbols(false), BuildSinks(false), HasGeneratedNode(false), + PurgingDeadSymbols(false), BuildSinks(false), hasGeneratedNode(false), PointKind(ProgramPoint::PostStmtKind), Tag(0) { Deferred.insert(N); CleanedState = Pred->getState(); @@ -706,7 +706,7 @@ SwitchNodeBuilder::generateDefaultCaseNode(const GRState* St, bool isSink) { EndOfFunctionNodeBuilder::~EndOfFunctionNodeBuilder() { // Auto-generate an EOP node if one has not been generated. - if (!HasGeneratedNode) { + if (!hasGeneratedNode) { // If we are in an inlined call, generate CallExit node. if (Pred->getLocationContext()->getParent()) GenerateCallExitNode(Pred->State); @@ -718,7 +718,7 @@ EndOfFunctionNodeBuilder::~EndOfFunctionNodeBuilder() { ExplodedNode* EndOfFunctionNodeBuilder::generateNode(const GRState* State, const void *tag, ExplodedNode* P) { - HasGeneratedNode = true; + hasGeneratedNode = true; bool IsNew; ExplodedNode* Node = Eng.G->getNode(BlockEntrance(&B, @@ -735,7 +735,7 @@ EndOfFunctionNodeBuilder::generateNode(const GRState* State, const void *tag, } void EndOfFunctionNodeBuilder::GenerateCallExitNode(const GRState *state) { - HasGeneratedNode = true; + hasGeneratedNode = true; // Create a CallExit node and enqueue it. const StackFrameContext *LocCtx = cast<StackFrameContext>(Pred->getLocationContext()); |