diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-12-22 18:53:44 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-12-22 18:53:44 +0000 |
commit | 1696f508e2fe95793ca8bb70d78b88023b6b8625 (patch) | |
tree | 1f556ca8b01869d6345236c16fb074251094950d /clang/lib | |
parent | ca08fba4141f1d3ae6193b3c81fb6ba8fb10d7dc (diff) | |
download | bcm5719-llvm-1696f508e2fe95793ca8bb70d78b88023b6b8625.tar.gz bcm5719-llvm-1696f508e2fe95793ca8bb70d78b88023b6b8625.zip |
[analyzer] Refactoring: Drop the 'GR' prefix.
llvm-svn: 122424
Diffstat (limited to 'clang/lib')
64 files changed, 520 insertions, 520 deletions
diff --git a/clang/lib/GR/AggExprVisitor.cpp b/clang/lib/GR/AggExprVisitor.cpp index 7f873bc14d5..45022986de7 100644 --- a/clang/lib/GR/AggExprVisitor.cpp +++ b/clang/lib/GR/AggExprVisitor.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" #include "clang/AST/StmtVisitor.h" using namespace clang; @@ -23,18 +23,18 @@ namespace { /// is used for evaluating exprs of C++ object type. Evaluating such exprs /// requires a destination pointer pointing to the object being evaluated /// into. Passing such a pointer around would pollute the Visit* interface of -/// GRExprEngine. AggExprVisitor encapsulates code that goes through various +/// ExprEngine. AggExprVisitor encapsulates code that goes through various /// cast and construct exprs (and others), and at the final point, dispatches -/// back to the GRExprEngine to let the real evaluation logic happen. +/// back to the ExprEngine to let the real evaluation logic happen. class AggExprVisitor : public StmtVisitor<AggExprVisitor> { const MemRegion *Dest; ExplodedNode *Pred; ExplodedNodeSet &DstSet; - GRExprEngine &Eng; + ExprEngine &Eng; public: AggExprVisitor(const MemRegion *dest, ExplodedNode *N, ExplodedNodeSet &dst, - GRExprEngine &eng) + ExprEngine &eng) : Dest(dest), Pred(N), DstSet(dst), Eng(eng) {} void VisitCastExpr(CastExpr *E); @@ -57,7 +57,7 @@ void AggExprVisitor::VisitCXXConstructExpr(CXXConstructExpr *E) { Eng.VisitCXXConstructExpr(E, Dest, Pred, DstSet); } -void GRExprEngine::VisitAggExpr(const Expr *E, const MemRegion *Dest, +void ExprEngine::VisitAggExpr(const Expr *E, const MemRegion *Dest, ExplodedNode *Pred, ExplodedNodeSet &Dst) { AggExprVisitor(Dest, Pred, Dst, *this).Visit(const_cast<Expr *>(E)); } diff --git a/clang/lib/GR/AnalysisConsumer.cpp b/clang/lib/GR/AnalysisConsumer.cpp index 0b2845119ab..f8a433943a1 100644 --- a/clang/lib/GR/AnalysisConsumer.cpp +++ b/clang/lib/GR/AnalysisConsumer.cpp @@ -25,13 +25,13 @@ #include "clang/GR/BugReporter/PathDiagnostic.h" #include "clang/GR/PathSensitive/AnalysisManager.h" #include "clang/GR/BugReporter/BugReporter.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" -#include "clang/GR/PathSensitive/GRTransferFuncs.h" +#include "clang/GR/PathSensitive/ExprEngine.h" +#include "clang/GR/PathSensitive/TransferFuncs.h" #include "clang/GR/PathDiagnosticClients.h" // FIXME: Restructure checker registration. -#include "Checkers/GRExprEngineExperimentalChecks.h" -#include "Checkers/GRExprEngineInternalChecks.h" +#include "Checkers/ExprEngineExperimentalChecks.h" +#include "Checkers/ExprEngineInternalChecks.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/SourceManager.h" @@ -328,18 +328,18 @@ static void ActionWarnUninitVals(AnalysisConsumer &C, AnalysisManager& mgr, } -static void ActionGRExprEngine(AnalysisConsumer &C, AnalysisManager& mgr, +static void ActionExprEngine(AnalysisConsumer &C, AnalysisManager& mgr, Decl *D, - GRTransferFuncs* tf) { + TransferFuncs* tf) { - llvm::OwningPtr<GRTransferFuncs> TF(tf); + llvm::OwningPtr<TransferFuncs> TF(tf); // Construct the analysis engine. We first query for the LiveVariables // information to see if the CFG is valid. // FIXME: Inter-procedural analysis will need to handle invalid CFGs. if (!mgr.getLiveVariables(D)) return; - GRExprEngine Eng(mgr, TF.take()); + ExprEngine Eng(mgr, TF.take()); if (C.Opts.EnableExperimentalInternalChecks) RegisterExperimentalInternalChecks(Eng); @@ -384,11 +384,11 @@ static void ActionGRExprEngine(AnalysisConsumer &C, AnalysisManager& mgr, static void ActionObjCMemCheckerAux(AnalysisConsumer &C, AnalysisManager& mgr, Decl *D, bool GCEnabled) { - GRTransferFuncs* TF = MakeCFRefCountTF(mgr.getASTContext(), + TransferFuncs* TF = MakeCFRefCountTF(mgr.getASTContext(), GCEnabled, mgr.getLangOptions()); - ActionGRExprEngine(C, mgr, D, TF); + ActionExprEngine(C, mgr, D, TF); } static void ActionObjCMemChecker(AnalysisConsumer &C, AnalysisManager& mgr, diff --git a/clang/lib/GR/AnalyzerStatsChecker.cpp b/clang/lib/GR/AnalyzerStatsChecker.cpp index cc9fcb7a472..c60b4504b2a 100644 --- a/clang/lib/GR/AnalyzerStatsChecker.cpp +++ b/clang/lib/GR/AnalyzerStatsChecker.cpp @@ -14,7 +14,7 @@ #include "clang/GR/BugReporter/BugReporter.h" // FIXME: Restructure checker registration. -#include "Checkers/GRExprEngineExperimentalChecks.h" +#include "Checkers/ExprEngineExperimentalChecks.h" #include "clang/Basic/SourceManager.h" #include "llvm/ADT/SmallPtrSet.h" @@ -26,7 +26,7 @@ namespace { class AnalyzerStatsChecker : public CheckerVisitor<AnalyzerStatsChecker> { public: static void *getTag(); - void VisitEndAnalysis(ExplodedGraph &G, BugReporter &B, GRExprEngine &Eng); + void VisitEndAnalysis(ExplodedGraph &G, BugReporter &B, ExprEngine &Eng); private: llvm::SmallPtrSet<const CFGBlock*, 256> reachable; @@ -38,13 +38,13 @@ void *AnalyzerStatsChecker::getTag() { return &x; } -void GR::RegisterAnalyzerStatsChecker(GRExprEngine &Eng) { +void GR::RegisterAnalyzerStatsChecker(ExprEngine &Eng) { Eng.registerCheck(new AnalyzerStatsChecker()); } void AnalyzerStatsChecker::VisitEndAnalysis(ExplodedGraph &G, BugReporter &B, - GRExprEngine &Eng) { + ExprEngine &Eng) { const CFG *C = 0; const Decl *D = 0; const LocationContext *LC = 0; @@ -109,8 +109,8 @@ void AnalyzerStatsChecker::VisitEndAnalysis(ExplodedGraph &G, D->getLocation()); // Emit warning for each block we bailed out on - typedef GRCoreEngine::BlocksAborted::const_iterator AbortedIterator; - const GRCoreEngine &CE = Eng.getCoreEngine(); + typedef CoreEngine::BlocksAborted::const_iterator AbortedIterator; + const CoreEngine &CE = Eng.getCoreEngine(); for (AbortedIterator I = CE.blocks_aborted_begin(), E = CE.blocks_aborted_end(); I != E; ++I) { const BlockEdge &BE = I->first; diff --git a/clang/lib/GR/BasicConstraintManager.cpp b/clang/lib/GR/BasicConstraintManager.cpp index ac289b89c2e..2de0d9a23cc 100644 --- a/clang/lib/GR/BasicConstraintManager.cpp +++ b/clang/lib/GR/BasicConstraintManager.cpp @@ -15,7 +15,7 @@ #include "SimpleConstraintManager.h" #include "clang/GR/PathSensitive/GRState.h" #include "clang/GR/PathSensitive/GRStateTrait.h" -#include "clang/GR/PathSensitive/GRTransferFuncs.h" +#include "clang/GR/PathSensitive/TransferFuncs.h" #include "llvm/Support/raw_ostream.h" using namespace clang; @@ -52,7 +52,7 @@ class BasicConstraintManager : public SimpleConstraintManager { GRState::IntSetTy::Factory ISetFactory; public: - BasicConstraintManager(GRStateManager &statemgr, GRSubEngine &subengine) + BasicConstraintManager(GRStateManager &statemgr, SubEngine &subengine) : SimpleConstraintManager(subengine), ISetFactory(statemgr.getAllocator()) {} @@ -99,7 +99,7 @@ public: } // end anonymous namespace ConstraintManager* GR::CreateBasicConstraintManager(GRStateManager& statemgr, - GRSubEngine &subengine) { + SubEngine &subengine) { return new BasicConstraintManager(statemgr, subengine); } diff --git a/clang/lib/GR/BasicStore.cpp b/clang/lib/GR/BasicStore.cpp index 2a673e24966..1c8ab11a96b 100644 --- a/clang/lib/GR/BasicStore.cpp +++ b/clang/lib/GR/BasicStore.cpp @@ -68,7 +68,7 @@ public: return store; } - /// ArrayToPointer - Used by GRExprEngine::VistCast to handle implicit + /// ArrayToPointer - Used by ExprEngine::VistCast to handle implicit /// conversions between arrays and pointers. SVal ArrayToPointer(Loc Array) { return Array; } diff --git a/clang/lib/GR/BasicValueFactory.cpp b/clang/lib/GR/BasicValueFactory.cpp index 6e94a2a91e1..7e45a15a9c0 100644 --- a/clang/lib/GR/BasicValueFactory.cpp +++ b/clang/lib/GR/BasicValueFactory.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // This file defines BasicValueFactory, a class that manages the lifetime -// of APSInt objects and symbolic constraints used by GRExprEngine +// of APSInt objects and symbolic constraints used by ExprEngine // and related classes. // //===----------------------------------------------------------------------===// diff --git a/clang/lib/GR/GRBlockCounter.cpp b/clang/lib/GR/BlockCounter.cpp index 8a026b1ed4b..ee76e7a2bc1 100644 --- a/clang/lib/GR/GRBlockCounter.cpp +++ b/clang/lib/GR/BlockCounter.cpp @@ -1,4 +1,4 @@ -//==- GRBlockCounter.h - ADT for counting block visits -------------*- C++ -*-// +//==- BlockCounter.h - ADT for counting block visits -------------*- C++ -*-// // // The LLVM Compiler Infrastructure // @@ -7,13 +7,13 @@ // //===----------------------------------------------------------------------===// // -// This file defines GRBlockCounter, an abstract data type used to count +// This file defines BlockCounter, an abstract data type used to count // the number of times a given block has been visited along a path -// analyzed by GRCoreEngine. +// analyzed by CoreEngine. // //===----------------------------------------------------------------------===// -#include "clang/GR/PathSensitive/GRBlockCounter.h" +#include "clang/GR/PathSensitive/BlockCounter.h" #include "llvm/ADT/ImmutableMap.h" using namespace clang; @@ -56,31 +56,31 @@ static inline CountMap::Factory& GetFactory(void* F) { return *static_cast<CountMap::Factory*>(F); } -unsigned GRBlockCounter::getNumVisited(const StackFrameContext *CallSite, +unsigned BlockCounter::getNumVisited(const StackFrameContext *CallSite, unsigned BlockID) const { CountMap M = GetMap(Data); CountMap::data_type* T = M.lookup(CountKey(CallSite, BlockID)); return T ? *T : 0; } -GRBlockCounter::Factory::Factory(llvm::BumpPtrAllocator& Alloc) { +BlockCounter::Factory::Factory(llvm::BumpPtrAllocator& Alloc) { F = new CountMap::Factory(Alloc); } -GRBlockCounter::Factory::~Factory() { +BlockCounter::Factory::~Factory() { delete static_cast<CountMap::Factory*>(F); } -GRBlockCounter -GRBlockCounter::Factory::IncrementCount(GRBlockCounter BC, +BlockCounter +BlockCounter::Factory::IncrementCount(BlockCounter BC, const StackFrameContext *CallSite, unsigned BlockID) { - return GRBlockCounter(GetFactory(F).add(GetMap(BC.Data), + return BlockCounter(GetFactory(F).add(GetMap(BC.Data), CountKey(CallSite, BlockID), BC.getNumVisited(CallSite, BlockID)+1).getRoot()); } -GRBlockCounter -GRBlockCounter::Factory::GetEmptyCounter() { - return GRBlockCounter(GetFactory(F).getEmptyMap().getRoot()); +BlockCounter +BlockCounter::Factory::GetEmptyCounter() { + return BlockCounter(GetFactory(F).getEmptyMap().getRoot()); } diff --git a/clang/lib/GR/BugReporter.cpp b/clang/lib/GR/BugReporter.cpp index 432182313b1..dedbd702bc8 100644 --- a/clang/lib/GR/BugReporter.cpp +++ b/clang/lib/GR/BugReporter.cpp @@ -14,7 +14,7 @@ #include "clang/GR/BugReporter/BugReporter.h" #include "clang/GR/BugReporter/BugType.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" #include "clang/AST/ASTContext.h" #include "clang/Analysis/CFG.h" #include "clang/AST/Expr.h" diff --git a/clang/lib/GR/CFRefCount.cpp b/clang/lib/GR/CFRefCount.cpp index 55d11a57b43..a99019cf373 100644 --- a/clang/lib/GR/CFRefCount.cpp +++ b/clang/lib/GR/CFRefCount.cpp @@ -21,9 +21,9 @@ #include "clang/GR/Checkers/LocalCheckers.h" #include "clang/Analysis/DomainSpecific/CocoaConventions.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" -#include "clang/GR/PathSensitive/GRExprEngineBuilders.h" +#include "clang/GR/PathSensitive/ExprEngineBuilders.h" #include "clang/GR/PathSensitive/GRStateTrait.h" -#include "clang/GR/PathSensitive/GRTransferFuncs.h" +#include "clang/GR/PathSensitive/TransferFuncs.h" #include "clang/GR/PathSensitive/SymbolManager.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/FoldingSet.h" @@ -92,16 +92,16 @@ ResolveToInterfaceMethodDecl(const ObjCMethodDecl *MD) { namespace { class GenericNodeBuilder { - GRStmtNodeBuilder *SNB; + StmtNodeBuilder *SNB; const Stmt *S; const void *tag; - GREndPathNodeBuilder *ENB; + EndPathNodeBuilder *ENB; public: - GenericNodeBuilder(GRStmtNodeBuilder &snb, const Stmt *s, + GenericNodeBuilder(StmtNodeBuilder &snb, const Stmt *s, const void *t) : SNB(&snb), S(s), tag(t), ENB(0) {} - GenericNodeBuilder(GREndPathNodeBuilder &enb) + GenericNodeBuilder(EndPathNodeBuilder &enb) : SNB(0), S(0), tag(0), ENB(&enb) {} ExplodedNode *MakeNode(const GRState *state, ExplodedNode *Pred) { @@ -1620,7 +1620,7 @@ static const GRState * SendAutorelease(const GRState *state, namespace { -class CFRefCount : public GRTransferFuncs { +class CFRefCount : public TransferFuncs { public: class BindingsPrinter : public GRState::Printer { public: @@ -1648,7 +1648,7 @@ private: RefVal::Kind& hasErr); void ProcessNonLeakError(ExplodedNodeSet& Dst, - GRStmtNodeBuilder& Builder, + StmtNodeBuilder& Builder, const Expr* NodeExpr, SourceRange ErrorRange, ExplodedNode* Pred, const GRState* St, @@ -1660,7 +1660,7 @@ private: ExplodedNode* ProcessLeaks(const GRState * state, llvm::SmallVectorImpl<SymbolRef> &Leaked, GenericNodeBuilder &Builder, - GRExprEngine &Eng, + ExprEngine &Eng, ExplodedNode *Pred = 0); public: @@ -1673,7 +1673,7 @@ public: virtual ~CFRefCount() {} - void RegisterChecks(GRExprEngine &Eng); + void RegisterChecks(ExprEngine &Eng); virtual void RegisterPrinters(std::vector<GRState::Printer*>& Printers) { Printers.push_back(new BindingsPrinter()); @@ -1690,8 +1690,8 @@ public: // Calls. void evalSummary(ExplodedNodeSet& Dst, - GRExprEngine& Eng, - GRStmtNodeBuilder& Builder, + ExprEngine& Eng, + StmtNodeBuilder& Builder, const Expr* Ex, InstanceReceiver Receiver, const RetainSummary& Summ, @@ -1700,42 +1700,42 @@ public: ExplodedNode* Pred, const GRState *state); virtual void evalCall(ExplodedNodeSet& Dst, - GRExprEngine& Eng, - GRStmtNodeBuilder& Builder, + ExprEngine& Eng, + StmtNodeBuilder& Builder, const CallExpr* CE, SVal L, ExplodedNode* Pred); virtual void evalObjCMessageExpr(ExplodedNodeSet& Dst, - GRExprEngine& Engine, - GRStmtNodeBuilder& Builder, + ExprEngine& Engine, + StmtNodeBuilder& Builder, const ObjCMessageExpr* ME, ExplodedNode* Pred, const GRState *state); // Stores. - virtual void evalBind(GRStmtNodeBuilderRef& B, SVal location, SVal val); + virtual void evalBind(StmtNodeBuilderRef& B, SVal location, SVal val); // End-of-path. - virtual void evalEndPath(GRExprEngine& Engine, - GREndPathNodeBuilder& Builder); + virtual void evalEndPath(ExprEngine& Engine, + EndPathNodeBuilder& Builder); virtual void evalDeadSymbols(ExplodedNodeSet& Dst, - GRExprEngine& Engine, - GRStmtNodeBuilder& Builder, + ExprEngine& Engine, + StmtNodeBuilder& Builder, ExplodedNode* Pred, const GRState* state, SymbolReaper& SymReaper); std::pair<ExplodedNode*, const GRState *> HandleAutoreleaseCounts(const GRState * state, GenericNodeBuilder Bd, - ExplodedNode* Pred, GRExprEngine &Eng, + ExplodedNode* Pred, ExprEngine &Eng, SymbolRef Sym, RefVal V, bool &stop); // Return statements. virtual void evalReturn(ExplodedNodeSet& Dst, - GRExprEngine& Engine, - GRStmtNodeBuilder& Builder, + ExprEngine& Engine, + StmtNodeBuilder& Builder, const ReturnStmt* S, ExplodedNode* Pred); @@ -1949,7 +1949,7 @@ namespace { public: CFRefLeakReport(CFRefBug& D, const CFRefCount &tf, ExplodedNode *n, SymbolRef sym, - GRExprEngine& Eng); + ExprEngine& Eng); PathDiagnosticPiece* getEndPath(BugReporterContext& BRC, const ExplodedNode* N); @@ -2407,7 +2407,7 @@ CFRefLeakReport::getEndPath(BugReporterContext& BRC, CFRefLeakReport::CFRefLeakReport(CFRefBug& D, const CFRefCount &tf, ExplodedNode *n, - SymbolRef sym, GRExprEngine& Eng) + SymbolRef sym, ExprEngine& Eng) : CFRefReport(D, tf, n, sym) { // Most bug reports are cached at the location where they occured. @@ -2474,8 +2474,8 @@ static QualType GetReturnType(const Expr* RetE, ASTContext& Ctx) { } void CFRefCount::evalSummary(ExplodedNodeSet& Dst, - GRExprEngine& Eng, - GRStmtNodeBuilder& Builder, + ExprEngine& Eng, + StmtNodeBuilder& Builder, const Expr* Ex, InstanceReceiver Receiver, const RetainSummary& Summ, @@ -2736,8 +2736,8 @@ void CFRefCount::evalSummary(ExplodedNodeSet& Dst, void CFRefCount::evalCall(ExplodedNodeSet& Dst, - GRExprEngine& Eng, - GRStmtNodeBuilder& Builder, + ExprEngine& Eng, + StmtNodeBuilder& Builder, const CallExpr* CE, SVal L, ExplodedNode* Pred) { @@ -2761,8 +2761,8 @@ void CFRefCount::evalCall(ExplodedNodeSet& Dst, } void CFRefCount::evalObjCMessageExpr(ExplodedNodeSet& Dst, - GRExprEngine& Eng, - GRStmtNodeBuilder& Builder, + ExprEngine& Eng, + StmtNodeBuilder& Builder, const ObjCMessageExpr* ME, ExplodedNode* Pred, const GRState *state) { @@ -2792,7 +2792,7 @@ public: } // end anonymous namespace -void CFRefCount::evalBind(GRStmtNodeBuilderRef& B, SVal location, SVal val) { +void CFRefCount::evalBind(StmtNodeBuilderRef& B, SVal location, SVal val) { // Are we storing to something that causes the value to "escape"? bool escapes = false; @@ -2832,8 +2832,8 @@ void CFRefCount::evalBind(GRStmtNodeBuilderRef& B, SVal location, SVal val) { // Return statements. void CFRefCount::evalReturn(ExplodedNodeSet& Dst, - GRExprEngine& Eng, - GRStmtNodeBuilder& Builder, + ExprEngine& Eng, + StmtNodeBuilder& Builder, const ReturnStmt* S, ExplodedNode* Pred) { @@ -3141,7 +3141,7 @@ const GRState * CFRefCount::Update(const GRState * state, SymbolRef sym, std::pair<ExplodedNode*, const GRState *> CFRefCount::HandleAutoreleaseCounts(const GRState * state, GenericNodeBuilder Bd, ExplodedNode* Pred, - GRExprEngine &Eng, + ExprEngine &Eng, SymbolRef Sym, RefVal V, bool &stop) { unsigned ACnt = V.getAutoreleaseCount(); @@ -3225,7 +3225,7 @@ ExplodedNode* CFRefCount::ProcessLeaks(const GRState * state, llvm::SmallVectorImpl<SymbolRef> &Leaked, GenericNodeBuilder &Builder, - GRExprEngine& Eng, + ExprEngine& Eng, ExplodedNode *Pred) { if (Leaked.empty()) @@ -3249,8 +3249,8 @@ CFRefCount::ProcessLeaks(const GRState * state, return N; } -void CFRefCount::evalEndPath(GRExprEngine& Eng, - GREndPathNodeBuilder& Builder) { +void CFRefCount::evalEndPath(ExprEngine& Eng, + EndPathNodeBuilder& Builder) { const GRState *state = Builder.getState(); GenericNodeBuilder Bd(Builder); @@ -3277,8 +3277,8 @@ void CFRefCount::evalEndPath(GRExprEngine& Eng, } void CFRefCount::evalDeadSymbols(ExplodedNodeSet& Dst, - GRExprEngine& Eng, - GRStmtNodeBuilder& Builder, + ExprEngine& Eng, + StmtNodeBuilder& Builder, ExplodedNode* Pred, const GRState* state, SymbolReaper& SymReaper) { @@ -3331,7 +3331,7 @@ void CFRefCount::evalDeadSymbols(ExplodedNodeSet& Dst, } void CFRefCount::ProcessNonLeakError(ExplodedNodeSet& Dst, - GRStmtNodeBuilder& Builder, + StmtNodeBuilder& Builder, const Expr* NodeExpr, SourceRange ErrorRange, ExplodedNode* Pred, @@ -3430,7 +3430,7 @@ void RetainReleaseChecker::PostVisitBlockExpr(CheckerContext &C, // Transfer function creation for external clients. //===----------------------------------------------------------------------===// -void CFRefCount::RegisterChecks(GRExprEngine& Eng) { +void CFRefCount::RegisterChecks(ExprEngine& Eng) { BugReporter &BR = Eng.getBugReporter(); useAfterRelease = new UseAfterRelease(this); @@ -3488,13 +3488,13 @@ void CFRefCount::RegisterChecks(GRExprEngine& Eng) { // Save the reference to the BugReporter. this->BR = &BR; - // Register the RetainReleaseChecker with the GRExprEngine object. + // Register the RetainReleaseChecker with the ExprEngine object. // Functionality in CFRefCount will be migrated to RetainReleaseChecker // over time. Eng.registerCheck(new RetainReleaseChecker(this)); } -GRTransferFuncs* GR::MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled, +TransferFuncs* GR::MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled, const LangOptions& lopts) { return new CFRefCount(Ctx, GCEnabled, lopts); } diff --git a/clang/lib/GR/CMakeLists.txt b/clang/lib/GR/CMakeLists.txt index 9cf7a3dcb2e..3b44fe3e465 100644 --- a/clang/lib/GR/CMakeLists.txt +++ b/clang/lib/GR/CMakeLists.txt @@ -19,10 +19,10 @@ add_clang_library(clangGRCore ExplodedGraph.cpp FlatStore.cpp FrontendActions.cpp - GRBlockCounter.cpp - GRCXXExprEngine.cpp - GRCoreEngine.cpp - GRExprEngine.cpp + BlockCounter.cpp + CXXExprEngine.cpp + CoreEngine.cpp + ExprEngine.cpp GRState.cpp HTMLDiagnostics.cpp ManagerRegistry.cpp diff --git a/clang/lib/GR/GRCXXExprEngine.cpp b/clang/lib/GR/CXXExprEngine.cpp index 24629551793..b1111c90fe5 100644 --- a/clang/lib/GR/GRCXXExprEngine.cpp +++ b/clang/lib/GR/CXXExprEngine.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "clang/GR/PathSensitive/AnalysisManager.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" #include "clang/AST/DeclCXX.h" using namespace clang; @@ -29,7 +29,7 @@ public: }; } -void GRExprEngine::evalArguments(ConstExprIterator AI, ConstExprIterator AE, +void ExprEngine::evalArguments(ConstExprIterator AI, ConstExprIterator AE, const FunctionProtoType *FnType, ExplodedNode *Pred, ExplodedNodeSet &Dst, bool FstArgAsLValue) { @@ -67,20 +67,20 @@ void GRExprEngine::evalArguments(ConstExprIterator AI, ConstExprIterator AE, } } -const CXXThisRegion *GRExprEngine::getCXXThisRegion(const CXXRecordDecl *D, +const CXXThisRegion *ExprEngine::getCXXThisRegion(const CXXRecordDecl *D, const StackFrameContext *SFC) { Type *T = D->getTypeForDecl(); QualType PT = getContext().getPointerType(QualType(T, 0)); return svalBuilder.getRegionManager().getCXXThisRegion(PT, SFC); } -const CXXThisRegion *GRExprEngine::getCXXThisRegion(const CXXMethodDecl *decl, +const CXXThisRegion *ExprEngine::getCXXThisRegion(const CXXMethodDecl *decl, const StackFrameContext *frameCtx) { return svalBuilder.getRegionManager(). getCXXThisRegion(decl->getThisType(getContext()), frameCtx); } -void GRExprEngine::CreateCXXTemporaryObject(const Expr *Ex, ExplodedNode *Pred, +void ExprEngine::CreateCXXTemporaryObject(const Expr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst) { ExplodedNodeSet Tmp; Visit(Ex, Pred, Tmp); @@ -100,7 +100,7 @@ void GRExprEngine::CreateCXXTemporaryObject(const Expr *Ex, ExplodedNode *Pred, } } -void GRExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *E, +void ExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *E, const MemRegion *Dest, ExplodedNode *Pred, ExplodedNodeSet &Dst) { @@ -147,7 +147,7 @@ void GRExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *E, } } -void GRExprEngine::VisitCXXDestructor(const CXXDestructorDecl *DD, +void ExprEngine::VisitCXXDestructor(const CXXDestructorDecl *DD, const MemRegion *Dest, const Stmt *S, ExplodedNode *Pred, @@ -171,7 +171,7 @@ void GRExprEngine::VisitCXXDestructor(const CXXDestructorDecl *DD, Dst.Add(N); } -void GRExprEngine::VisitCXXMemberCallExpr(const CXXMemberCallExpr *MCE, +void ExprEngine::VisitCXXMemberCallExpr(const CXXMemberCallExpr *MCE, ExplodedNode *Pred, ExplodedNodeSet &Dst) { // Get the method type. @@ -200,7 +200,7 @@ void GRExprEngine::VisitCXXMemberCallExpr(const CXXMemberCallExpr *MCE, evalMethodCall(MCE, MD, ObjArgExpr, Pred, AllargsEvaluated, Dst); } -void GRExprEngine::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *C, +void ExprEngine::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *C, ExplodedNode *Pred, ExplodedNodeSet &Dst) { const CXXMethodDecl *MD = dyn_cast_or_null<CXXMethodDecl>(C->getCalleeDecl()); @@ -225,7 +225,7 @@ void GRExprEngine::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *C, evalMethodCall(C, MD, C->getArg(0), Pred, argsEvaluated, Dst); } -void GRExprEngine::evalMethodCall(const CallExpr *MCE, const CXXMethodDecl *MD, +void ExprEngine::evalMethodCall(const CallExpr *MCE, const CXXMethodDecl *MD, const Expr *ThisExpr, ExplodedNode *Pred, ExplodedNodeSet &Src, ExplodedNodeSet &Dst) { // Allow checkers to pre-visit the member call. @@ -254,7 +254,7 @@ void GRExprEngine::evalMethodCall(const CallExpr *MCE, const CXXMethodDecl *MD, } } -void GRExprEngine::VisitCXXNewExpr(const CXXNewExpr *CNE, ExplodedNode *Pred, +void ExprEngine::VisitCXXNewExpr(const CXXNewExpr *CNE, ExplodedNode *Pred, ExplodedNodeSet &Dst) { if (CNE->isArray()) { // FIXME: allocating an array has not been handled. @@ -302,7 +302,7 @@ void GRExprEngine::VisitCXXNewExpr(const CXXNewExpr *CNE, ExplodedNode *Pred, } } -void GRExprEngine::VisitCXXDeleteExpr(const CXXDeleteExpr *CDE, +void ExprEngine::VisitCXXDeleteExpr(const CXXDeleteExpr *CDE, ExplodedNode *Pred,ExplodedNodeSet &Dst) { // Should do more checking. ExplodedNodeSet Argevaluated; @@ -314,7 +314,7 @@ void GRExprEngine::VisitCXXDeleteExpr(const CXXDeleteExpr *CDE, } } -void GRExprEngine::VisitCXXThisExpr(const CXXThisExpr *TE, ExplodedNode *Pred, +void ExprEngine::VisitCXXThisExpr(const CXXThisExpr *TE, ExplodedNode *Pred, ExplodedNodeSet &Dst) { // Get the this object region from StoreManager. const MemRegion *R = diff --git a/clang/lib/GR/Checkers/AdjustedReturnValueChecker.cpp b/clang/lib/GR/Checkers/AdjustedReturnValueChecker.cpp index d9cfd3cac84..3c78b39d207 100644 --- a/clang/lib/GR/Checkers/AdjustedReturnValueChecker.cpp +++ b/clang/lib/GR/Checkers/AdjustedReturnValueChecker.cpp @@ -13,9 +13,9 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugReporter.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" using namespace clang; @@ -35,7 +35,7 @@ public: }; } -void GR::RegisterAdjustedReturnValueChecker(GRExprEngine &Eng) { +void GR::RegisterAdjustedReturnValueChecker(ExprEngine &Eng) { Eng.registerCheck(new AdjustedReturnValueChecker()); } diff --git a/clang/lib/GR/Checkers/ArrayBoundChecker.cpp b/clang/lib/GR/Checkers/ArrayBoundChecker.cpp index f97adf3d145..9dc53a2360b 100644 --- a/clang/lib/GR/Checkers/ArrayBoundChecker.cpp +++ b/clang/lib/GR/Checkers/ArrayBoundChecker.cpp @@ -12,10 +12,10 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" using namespace clang; using namespace GR; @@ -31,7 +31,7 @@ public: }; } -void GR::RegisterArrayBoundChecker(GRExprEngine &Eng) { +void GR::RegisterArrayBoundChecker(ExprEngine &Eng) { Eng.registerCheck(new ArrayBoundChecker()); } diff --git a/clang/lib/GR/Checkers/AttrNonNullChecker.cpp b/clang/lib/GR/Checkers/AttrNonNullChecker.cpp index baf209e3c86..74eb882d545 100644 --- a/clang/lib/GR/Checkers/AttrNonNullChecker.cpp +++ b/clang/lib/GR/Checkers/AttrNonNullChecker.cpp @@ -7,12 +7,12 @@ // //===----------------------------------------------------------------------===// // -// This defines AttrNonNullChecker, a builtin check in GRExprEngine that +// This defines AttrNonNullChecker, a builtin check in ExprEngine that // performs checks for arguments declared to have nonnull attribute. // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" @@ -33,7 +33,7 @@ public: }; } // end anonymous namespace -void GR::RegisterAttrNonNullChecker(GRExprEngine &Eng) { +void GR::RegisterAttrNonNullChecker(ExprEngine &Eng) { Eng.registerCheck(new AttrNonNullChecker()); } diff --git a/clang/lib/GR/Checkers/BasicObjCFoundationChecks.cpp b/clang/lib/GR/Checkers/BasicObjCFoundationChecks.cpp index 93c8babde13..33a58bdec9a 100644 --- a/clang/lib/GR/Checkers/BasicObjCFoundationChecks.cpp +++ b/clang/lib/GR/Checkers/BasicObjCFoundationChecks.cpp @@ -17,7 +17,7 @@ #include "clang/GR/PathSensitive/ExplodedGraph.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" #include "clang/GR/PathSensitive/GRState.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/MemRegion.h" @@ -511,7 +511,7 @@ void ClassReleaseChecker::PreVisitObjCMessageExpr(CheckerContext &C, // Check registration. //===----------------------------------------------------------------------===// -void GR::RegisterAppleChecks(GRExprEngine& Eng, const Decl &D) { +void GR::RegisterAppleChecks(ExprEngine& Eng, const Decl &D) { Eng.registerCheck(new NilArgChecker()); Eng.registerCheck(new CFNumberCreateChecker()); RegisterNSErrorChecks(Eng.getBugReporter(), Eng, D); diff --git a/clang/lib/GR/Checkers/BasicObjCFoundationChecks.h b/clang/lib/GR/Checkers/BasicObjCFoundationChecks.h index 7fdccdcacb8..63143ebe252 100644 --- a/clang/lib/GR/Checkers/BasicObjCFoundationChecks.h +++ b/clang/lib/GR/Checkers/BasicObjCFoundationChecks.h @@ -24,10 +24,10 @@ class Decl; namespace GR { class BugReporter; -class GRExprEngine; +class ExprEngine; -void RegisterNSErrorChecks(BugReporter& BR, GRExprEngine &Eng, const Decl &D); -void RegisterNSAutoreleasePoolChecks(GRExprEngine &Eng); +void RegisterNSErrorChecks(BugReporter& BR, ExprEngine &Eng, const Decl &D); +void RegisterNSAutoreleasePoolChecks(ExprEngine &Eng); } // end GR namespace diff --git a/clang/lib/GR/Checkers/BuiltinFunctionChecker.cpp b/clang/lib/GR/Checkers/BuiltinFunctionChecker.cpp index dc55a65ff5a..27162e40af9 100644 --- a/clang/lib/GR/Checkers/BuiltinFunctionChecker.cpp +++ b/clang/lib/GR/Checkers/BuiltinFunctionChecker.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/PathSensitive/Checker.h" #include "clang/Basic/Builtins.h" @@ -28,7 +28,7 @@ public: } -void GR::RegisterBuiltinFunctionChecker(GRExprEngine &Eng) { +void GR::RegisterBuiltinFunctionChecker(ExprEngine &Eng) { Eng.registerCheck(new BuiltinFunctionChecker()); } diff --git a/clang/lib/GR/Checkers/CMakeLists.txt b/clang/lib/GR/Checkers/CMakeLists.txt index 700adb544b8..cae050d94cb 100644 --- a/clang/lib/GR/Checkers/CMakeLists.txt +++ b/clang/lib/GR/Checkers/CMakeLists.txt @@ -17,7 +17,7 @@ add_clang_library(clangGRCheckers DereferenceChecker.cpp DivZeroChecker.cpp FixedAddressChecker.cpp - GRExprEngineExperimentalChecks.cpp + ExprEngineExperimentalChecks.cpp IdempotentOperationChecker.cpp LLVMConventionsChecker.cpp MacOSXAPIChecker.cpp diff --git a/clang/lib/GR/Checkers/CStringChecker.cpp b/clang/lib/GR/Checkers/CStringChecker.cpp index da0bba37416..a9d3064fcaf 100644 --- a/clang/lib/GR/Checkers/CStringChecker.cpp +++ b/clang/lib/GR/Checkers/CStringChecker.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineExperimentalChecks.h" +#include "ExprEngineExperimentalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" #include "clang/GR/PathSensitive/GRStateTrait.h" @@ -109,7 +109,7 @@ namespace GR { } } -void GR::RegisterCStringChecker(GRExprEngine &Eng) { +void GR::RegisterCStringChecker(ExprEngine &Eng) { Eng.registerCheck(new CStringChecker()); } diff --git a/clang/lib/GR/Checkers/CallAndMessageChecker.cpp b/clang/lib/GR/Checkers/CallAndMessageChecker.cpp index 8b8f75faf68..f3306d136bc 100644 --- a/clang/lib/GR/Checkers/CallAndMessageChecker.cpp +++ b/clang/lib/GR/Checkers/CallAndMessageChecker.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/AST/ParentMap.h" #include "clang/Basic/TargetInfo.h" #include "clang/GR/BugReporter/BugType.h" @@ -62,7 +62,7 @@ private: }; } // end anonymous namespace -void GR::RegisterCallAndMessageChecker(GRExprEngine &Eng) { +void GR::RegisterCallAndMessageChecker(ExprEngine &Eng) { Eng.registerCheck(new CallAndMessageChecker()); } diff --git a/clang/lib/GR/Checkers/CastSizeChecker.cpp b/clang/lib/GR/Checkers/CastSizeChecker.cpp index bcbb89441f4..c17dc7a266e 100644 --- a/clang/lib/GR/Checkers/CastSizeChecker.cpp +++ b/clang/lib/GR/Checkers/CastSizeChecker.cpp @@ -14,7 +14,7 @@ #include "clang/AST/CharUnits.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" using namespace clang; using namespace GR; @@ -86,6 +86,6 @@ void CastSizeChecker::PreVisitCastExpr(CheckerContext &C, const CastExpr *CE) { } -void GR::RegisterCastSizeChecker(GRExprEngine &Eng) { +void GR::RegisterCastSizeChecker(ExprEngine &Eng) { Eng.registerCheck(new CastSizeChecker()); } diff --git a/clang/lib/GR/Checkers/CastToStructChecker.cpp b/clang/lib/GR/Checkers/CastToStructChecker.cpp index 0bcba284b86..7b0732938c1 100644 --- a/clang/lib/GR/Checkers/CastToStructChecker.cpp +++ b/clang/lib/GR/Checkers/CastToStructChecker.cpp @@ -15,7 +15,7 @@ #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" using namespace clang; using namespace GR; @@ -74,6 +74,6 @@ void CastToStructChecker::PreVisitCastExpr(CheckerContext &C, } } -void GR::RegisterCastToStructChecker(GRExprEngine &Eng) { +void GR::RegisterCastToStructChecker(ExprEngine &Eng) { Eng.registerCheck(new CastToStructChecker()); } diff --git a/clang/lib/GR/Checkers/CheckDeadStores.cpp b/clang/lib/GR/Checkers/CheckDeadStores.cpp index 44fdb3afbba..edcf57ceca2 100644 --- a/clang/lib/GR/Checkers/CheckDeadStores.cpp +++ b/clang/lib/GR/Checkers/CheckDeadStores.cpp @@ -16,7 +16,7 @@ #include "clang/Analysis/Analyses/LiveVariables.h" #include "clang/Analysis/Visitors/CFGRecStmtVisitor.h" #include "clang/GR/BugReporter/BugReporter.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" #include "clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h" #include "clang/Basic/Diagnostic.h" #include "clang/AST/ASTContext.h" diff --git a/clang/lib/GR/Checkers/ChrootChecker.cpp b/clang/lib/GR/Checkers/ChrootChecker.cpp index f93ee7b9416..58b34d08520 100644 --- a/clang/lib/GR/Checkers/ChrootChecker.cpp +++ b/clang/lib/GR/Checkers/ChrootChecker.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineExperimentalChecks.h" +#include "ExprEngineExperimentalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" #include "clang/GR/PathSensitive/GRState.h" @@ -59,7 +59,7 @@ private: } // end anonymous namespace -void GR::RegisterChrootChecker(GRExprEngine &Eng) { +void GR::RegisterChrootChecker(ExprEngine &Eng) { Eng.registerCheck(new ChrootChecker()); } diff --git a/clang/lib/GR/Checkers/DereferenceChecker.cpp b/clang/lib/GR/Checkers/DereferenceChecker.cpp index 62b1f86fb48..dbe0ab3262e 100644 --- a/clang/lib/GR/Checkers/DereferenceChecker.cpp +++ b/clang/lib/GR/Checkers/DereferenceChecker.cpp @@ -7,16 +7,16 @@ // //===----------------------------------------------------------------------===// // -// This defines NullDerefChecker, a builtin check in GRExprEngine that performs +// This defines NullDerefChecker, a builtin check in ExprEngine that performs // checks for null pointers at loads and stores. // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/Checkers/DereferenceChecker.h" #include "clang/GR/PathSensitive/Checker.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" using namespace clang; using namespace GR; @@ -43,12 +43,12 @@ public: }; } // end anonymous namespace -void GR::RegisterDereferenceChecker(GRExprEngine &Eng) { +void GR::RegisterDereferenceChecker(ExprEngine &Eng) { Eng.registerCheck(new DereferenceChecker()); } std::pair<ExplodedNode * const *, ExplodedNode * const *> -GR::GetImplicitNullDereferences(GRExprEngine &Eng) { +GR::GetImplicitNullDereferences(ExprEngine &Eng) { DereferenceChecker *checker = Eng.getChecker<DereferenceChecker>(); if (!checker) return std::make_pair((ExplodedNode * const *) 0, diff --git a/clang/lib/GR/Checkers/DivZeroChecker.cpp b/clang/lib/GR/Checkers/DivZeroChecker.cpp index a4cb1a4a130..1475a9e1cd3 100644 --- a/clang/lib/GR/Checkers/DivZeroChecker.cpp +++ b/clang/lib/GR/Checkers/DivZeroChecker.cpp @@ -7,12 +7,12 @@ // //===----------------------------------------------------------------------===// // -// This defines DivZeroChecker, a builtin check in GRExprEngine that performs +// This defines DivZeroChecker, a builtin check in ExprEngine that performs // checks for division by zeros. // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" @@ -29,7 +29,7 @@ public: }; } // end anonymous namespace -void GR::RegisterDivZeroChecker(GRExprEngine &Eng) { +void GR::RegisterDivZeroChecker(ExprEngine &Eng) { Eng.registerCheck(new DivZeroChecker()); } diff --git a/clang/lib/GR/Checkers/GRExprEngineExperimentalChecks.cpp b/clang/lib/GR/Checkers/ExprEngineExperimentalChecks.cpp index fd9bf5dd520..d7ad99ffc22 100644 --- a/clang/lib/GR/Checkers/GRExprEngineExperimentalChecks.cpp +++ b/clang/lib/GR/Checkers/ExprEngineExperimentalChecks.cpp @@ -1,4 +1,4 @@ -//=-- GRExprEngineExperimentalChecks.h ------------------------------*- C++ -*-= +//=-- ExprEngineExperimentalChecks.h ------------------------------*- C++ -*-= // // The LLVM Compiler Infrastructure // @@ -8,20 +8,20 @@ //===----------------------------------------------------------------------===// // // This file defines functions to instantiate and register experimental -// checks in GRExprEngine. +// checks in ExprEngine. // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" -#include "GRExprEngineExperimentalChecks.h" +#include "ExprEngineInternalChecks.h" +#include "ExprEngineExperimentalChecks.h" #include "clang/GR/Checkers/LocalCheckers.h" using namespace clang; using namespace GR; -void GR::RegisterExperimentalChecks(GRExprEngine &Eng) { +void GR::RegisterExperimentalChecks(ExprEngine &Eng) { // These are checks that never belong as internal checks - // within GRExprEngine. + // within ExprEngine. RegisterCStringChecker(Eng); RegisterChrootChecker(Eng); RegisterMallocChecker(Eng); @@ -30,7 +30,7 @@ void GR::RegisterExperimentalChecks(GRExprEngine &Eng) { RegisterUnreachableCodeChecker(Eng); } -void GR::RegisterExperimentalInternalChecks(GRExprEngine &Eng) { +void GR::RegisterExperimentalInternalChecks(ExprEngine &Eng) { // These are internal checks that should eventually migrate to // RegisterInternalChecks() once they have been further tested. diff --git a/clang/lib/GR/Checkers/ExprEngineExperimentalChecks.h b/clang/lib/GR/Checkers/ExprEngineExperimentalChecks.h new file mode 100644 index 00000000000..4a04fb9b2f7 --- /dev/null +++ b/clang/lib/GR/Checkers/ExprEngineExperimentalChecks.h @@ -0,0 +1,37 @@ +//=-- ExprEngineExperimentalChecks.h ------------------------------*- C++ -*-= +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines functions to instantiate and register experimental +// checks in ExprEngine. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_GR_ExprEngine_EXPERIMENTAL_CHECKS +#define LLVM_CLANG_GR_ExprEngine_EXPERIMENTAL_CHECKS + +namespace clang { + +namespace GR { + +class ExprEngine; + +void RegisterAnalyzerStatsChecker(ExprEngine &Eng); +void RegisterChrootChecker(ExprEngine &Eng); +void RegisterCStringChecker(ExprEngine &Eng); +void RegisterIdempotentOperationChecker(ExprEngine &Eng); +void RegisterMallocChecker(ExprEngine &Eng); +void RegisterPthreadLockChecker(ExprEngine &Eng); +void RegisterStreamChecker(ExprEngine &Eng); +void RegisterUnreachableCodeChecker(ExprEngine &Eng); + +} // end GR namespace + +} // end clang namespace + +#endif diff --git a/clang/lib/GR/Checkers/ExprEngineInternalChecks.h b/clang/lib/GR/Checkers/ExprEngineInternalChecks.h new file mode 100644 index 00000000000..aa2f99b1a11 --- /dev/null +++ b/clang/lib/GR/Checkers/ExprEngineInternalChecks.h @@ -0,0 +1,58 @@ +//=-- ExprEngineInternalChecks.h- Builtin ExprEngine Checks -----*- C++ -*-= +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines functions to instantiate and register the "built-in" +// checks in ExprEngine. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_GR_ExprEngine_INTERNAL_CHECKS +#define LLVM_CLANG_GR_ExprEngine_INTERNAL_CHECKS + +namespace clang { + +namespace GR { + +class ExprEngine; + +// Foundational checks that handle basic semantics. +void RegisterAdjustedReturnValueChecker(ExprEngine &Eng); +void RegisterArrayBoundChecker(ExprEngine &Eng); +void RegisterAttrNonNullChecker(ExprEngine &Eng); +void RegisterBuiltinFunctionChecker(ExprEngine &Eng); +void RegisterCallAndMessageChecker(ExprEngine &Eng); +void RegisterCastToStructChecker(ExprEngine &Eng); +void RegisterCastSizeChecker(ExprEngine &Eng); +void RegisterDereferenceChecker(ExprEngine &Eng); +void RegisterDivZeroChecker(ExprEngine &Eng); +void RegisterFixedAddressChecker(ExprEngine &Eng); +void RegisterNoReturnFunctionChecker(ExprEngine &Eng); +void RegisterObjCAtSyncChecker(ExprEngine &Eng); +void RegisterPointerArithChecker(ExprEngine &Eng); +void RegisterPointerSubChecker(ExprEngine &Eng); +void RegisterReturnPointerRangeChecker(ExprEngine &Eng); +void RegisterReturnUndefChecker(ExprEngine &Eng); +void RegisterStackAddrLeakChecker(ExprEngine &Eng); +void RegisterUndefBranchChecker(ExprEngine &Eng); +void RegisterUndefCapturedBlockVarChecker(ExprEngine &Eng); +void RegisterUndefResultChecker(ExprEngine &Eng); +void RegisterUndefinedArraySubscriptChecker(ExprEngine &Eng); +void RegisterUndefinedAssignmentChecker(ExprEngine &Eng); +void RegisterVLASizeChecker(ExprEngine &Eng); + +// API checks. +void RegisterMacOSXAPIChecker(ExprEngine &Eng); +void RegisterOSAtomicChecker(ExprEngine &Eng); +void RegisterUnixAPIChecker(ExprEngine &Eng); + +} // end GR namespace + +} // end clang namespace + +#endif diff --git a/clang/lib/GR/Checkers/FixedAddressChecker.cpp b/clang/lib/GR/Checkers/FixedAddressChecker.cpp index 4c7086f4f1e..d7caad17dab 100644 --- a/clang/lib/GR/Checkers/FixedAddressChecker.cpp +++ b/clang/lib/GR/Checkers/FixedAddressChecker.cpp @@ -13,7 +13,7 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" @@ -67,6 +67,6 @@ void FixedAddressChecker::PreVisitBinaryOperator(CheckerContext &C, } } -void GR::RegisterFixedAddressChecker(GRExprEngine &Eng) { +void GR::RegisterFixedAddressChecker(ExprEngine &Eng) { Eng.registerCheck(new FixedAddressChecker()); } diff --git a/clang/lib/GR/Checkers/GRExprEngineExperimentalChecks.h b/clang/lib/GR/Checkers/GRExprEngineExperimentalChecks.h deleted file mode 100644 index 54a61256590..00000000000 --- a/clang/lib/GR/Checkers/GRExprEngineExperimentalChecks.h +++ /dev/null @@ -1,37 +0,0 @@ -//=-- GRExprEngineExperimentalChecks.h ------------------------------*- C++ -*-= -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines functions to instantiate and register experimental -// checks in GRExprEngine. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_GR_GREXPRENGINE_EXPERIMENTAL_CHECKS -#define LLVM_CLANG_GR_GREXPRENGINE_EXPERIMENTAL_CHECKS - -namespace clang { - -namespace GR { - -class GRExprEngine; - -void RegisterAnalyzerStatsChecker(GRExprEngine &Eng); -void RegisterChrootChecker(GRExprEngine &Eng); -void RegisterCStringChecker(GRExprEngine &Eng); -void RegisterIdempotentOperationChecker(GRExprEngine &Eng); -void RegisterMallocChecker(GRExprEngine &Eng); -void RegisterPthreadLockChecker(GRExprEngine &Eng); -void RegisterStreamChecker(GRExprEngine &Eng); -void RegisterUnreachableCodeChecker(GRExprEngine &Eng); - -} // end GR namespace - -} // end clang namespace - -#endif diff --git a/clang/lib/GR/Checkers/GRExprEngineInternalChecks.h b/clang/lib/GR/Checkers/GRExprEngineInternalChecks.h deleted file mode 100644 index cba419a9b60..00000000000 --- a/clang/lib/GR/Checkers/GRExprEngineInternalChecks.h +++ /dev/null @@ -1,58 +0,0 @@ -//=-- GRExprEngineInternalChecks.h- Builtin GRExprEngine Checks -----*- C++ -*-= -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines functions to instantiate and register the "built-in" -// checks in GRExprEngine. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_GR_GREXPRENGINE_INTERNAL_CHECKS -#define LLVM_CLANG_GR_GREXPRENGINE_INTERNAL_CHECKS - -namespace clang { - -namespace GR { - -class GRExprEngine; - -// Foundational checks that handle basic semantics. -void RegisterAdjustedReturnValueChecker(GRExprEngine &Eng); -void RegisterArrayBoundChecker(GRExprEngine &Eng); -void RegisterAttrNonNullChecker(GRExprEngine &Eng); -void RegisterBuiltinFunctionChecker(GRExprEngine &Eng); -void RegisterCallAndMessageChecker(GRExprEngine &Eng); -void RegisterCastToStructChecker(GRExprEngine &Eng); -void RegisterCastSizeChecker(GRExprEngine &Eng); -void RegisterDereferenceChecker(GRExprEngine &Eng); -void RegisterDivZeroChecker(GRExprEngine &Eng); -void RegisterFixedAddressChecker(GRExprEngine &Eng); -void RegisterNoReturnFunctionChecker(GRExprEngine &Eng); -void RegisterObjCAtSyncChecker(GRExprEngine &Eng); -void RegisterPointerArithChecker(GRExprEngine &Eng); -void RegisterPointerSubChecker(GRExprEngine &Eng); -void RegisterReturnPointerRangeChecker(GRExprEngine &Eng); -void RegisterReturnUndefChecker(GRExprEngine &Eng); -void RegisterStackAddrLeakChecker(GRExprEngine &Eng); -void RegisterUndefBranchChecker(GRExprEngine &Eng); -void RegisterUndefCapturedBlockVarChecker(GRExprEngine &Eng); -void RegisterUndefResultChecker(GRExprEngine &Eng); -void RegisterUndefinedArraySubscriptChecker(GRExprEngine &Eng); -void RegisterUndefinedAssignmentChecker(GRExprEngine &Eng); -void RegisterVLASizeChecker(GRExprEngine &Eng); - -// API checks. -void RegisterMacOSXAPIChecker(GRExprEngine &Eng); -void RegisterOSAtomicChecker(GRExprEngine &Eng); -void RegisterUnixAPIChecker(GRExprEngine &Eng); - -} // end GR namespace - -} // end clang namespace - -#endif diff --git a/clang/lib/GR/Checkers/IdempotentOperationChecker.cpp b/clang/lib/GR/Checkers/IdempotentOperationChecker.cpp index b28edc3b12d..15e9be95804 100644 --- a/clang/lib/GR/Checkers/IdempotentOperationChecker.cpp +++ b/clang/lib/GR/Checkers/IdempotentOperationChecker.cpp @@ -42,14 +42,14 @@ // - Finer grained false positive control (levels) // - Handling ~0 values -#include "GRExprEngineExperimentalChecks.h" +#include "ExprEngineExperimentalChecks.h" #include "clang/Analysis/CFGStmtMap.h" #include "clang/Analysis/Analyses/PseudoConstantAnalysis.h" #include "clang/GR/BugReporter/BugReporter.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerHelpers.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" -#include "clang/GR/PathSensitive/GRCoreEngine.h" +#include "clang/GR/PathSensitive/CoreEngine.h" #include "clang/GR/PathSensitive/SVals.h" #include "clang/AST/Stmt.h" #include "llvm/ADT/DenseMap.h" @@ -67,7 +67,7 @@ public: static void *getTag(); void PreVisitBinaryOperator(CheckerContext &C, const BinaryOperator *B); void PostVisitBinaryOperator(CheckerContext &C, const BinaryOperator *B); - void VisitEndAnalysis(ExplodedGraph &G, BugReporter &B, GRExprEngine &Eng); + void VisitEndAnalysis(ExplodedGraph &G, BugReporter &B, ExprEngine &Eng); private: // Our assumption about a particular operation. @@ -84,7 +84,7 @@ private: bool PathWasCompletelyAnalyzed(const CFG *C, const CFGBlock *CB, const CFGStmtMap *CBM, - const GRCoreEngine &CE); + const CoreEngine &CE); static bool CanVary(const Expr *Ex, AnalysisContext *AC); static bool isConstantOrPseudoConstant(const DeclRefExpr *DR, @@ -130,7 +130,7 @@ void *IdempotentOperationChecker::getTag() { return &x; } -void GR::RegisterIdempotentOperationChecker(GRExprEngine &Eng) { +void GR::RegisterIdempotentOperationChecker(ExprEngine &Eng) { Eng.registerCheck(new IdempotentOperationChecker()); } @@ -364,7 +364,7 @@ void IdempotentOperationChecker::PostVisitBinaryOperator( void IdempotentOperationChecker::VisitEndAnalysis(ExplodedGraph &G, BugReporter &BR, - GRExprEngine &Eng) { + ExprEngine &Eng) { BugType *BT = new BugType("Idempotent operation", "Dead code"); // Iterate over the hash to see if we have any paths with definite // idempotent operations. @@ -553,9 +553,9 @@ bool IdempotentOperationChecker::PathWasCompletelyAnalyzed( const CFG *C, const CFGBlock *CB, const CFGStmtMap *CBM, - const GRCoreEngine &CE) { + const CoreEngine &CE) { // Test for reachability from any aborted blocks to this block - typedef GRCoreEngine::BlocksAborted::const_iterator AbortedIterator; + typedef CoreEngine::BlocksAborted::const_iterator AbortedIterator; for (AbortedIterator I = CE.blocks_aborted_begin(), E = CE.blocks_aborted_end(); I != E; ++I) { const BlockEdge &BE = I->first; @@ -569,7 +569,7 @@ bool IdempotentOperationChecker::PathWasCompletelyAnalyzed( // For the items still on the worklist, see if they are in blocks that // can eventually reach 'CB'. - class VisitWL : public GRWorkList::Visitor { + class VisitWL : public WorkList::Visitor { const CFGStmtMap *CBM; const CFGBlock *TargetBlock; CFGReachabilityAnalysis &CRA; @@ -577,7 +577,7 @@ bool IdempotentOperationChecker::PathWasCompletelyAnalyzed( VisitWL(const CFGStmtMap *cbm, const CFGBlock *targetBlock, CFGReachabilityAnalysis &cra) : CBM(cbm), TargetBlock(targetBlock), CRA(cra) {} - virtual bool Visit(const GRWorkListUnit &U) { + virtual bool Visit(const WorkListUnit &U) { ProgramPoint P = U.getNode()->getLocation(); const CFGBlock *B = 0; if (StmtPoint *SP = dyn_cast<StmtPoint>(&P)) { diff --git a/clang/lib/GR/Checkers/MacOSXAPIChecker.cpp b/clang/lib/GR/Checkers/MacOSXAPIChecker.cpp index 316e37a40f4..d7728713f88 100644 --- a/clang/lib/GR/Checkers/MacOSXAPIChecker.cpp +++ b/clang/lib/GR/Checkers/MacOSXAPIChecker.cpp @@ -15,7 +15,7 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/Basic/TargetInfo.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" @@ -45,7 +45,7 @@ public: }; } //end anonymous namespace -void GR::RegisterMacOSXAPIChecker(GRExprEngine &Eng) { +void GR::RegisterMacOSXAPIChecker(ExprEngine &Eng) { if (Eng.getContext().Target.getTriple().getVendor() == llvm::Triple::Apple) Eng.registerCheck(new MacOSXAPIChecker()); } diff --git a/clang/lib/GR/Checkers/MallocChecker.cpp b/clang/lib/GR/Checkers/MallocChecker.cpp index cd5f636e961..bbfc7b076d3 100644 --- a/clang/lib/GR/Checkers/MallocChecker.cpp +++ b/clang/lib/GR/Checkers/MallocChecker.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineExperimentalChecks.h" +#include "ExprEngineExperimentalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" #include "clang/GR/PathSensitive/GRState.h" @@ -78,7 +78,7 @@ public: static void *getTag(); bool evalCallExpr(CheckerContext &C, const CallExpr *CE); void evalDeadSymbols(CheckerContext &C, SymbolReaper &SymReaper); - void evalEndPath(GREndPathNodeBuilder &B, void *tag, GRExprEngine &Eng); + void evalEndPath(EndPathNodeBuilder &B, void *tag, ExprEngine &Eng); void PreVisitReturnStmt(CheckerContext &C, const ReturnStmt *S); const GRState *evalAssume(const GRState *state, SVal Cond, bool Assumption, bool *respondsToCallback); @@ -126,7 +126,7 @@ namespace GR { } } -void GR::RegisterMallocChecker(GRExprEngine &Eng) { +void GR::RegisterMallocChecker(ExprEngine &Eng) { Eng.registerCheck(new MallocChecker()); } @@ -593,8 +593,8 @@ void MallocChecker::evalDeadSymbols(CheckerContext &C, SymbolReaper &SymReaper) C.generateNode(state->set<RegionState>(RS)); } -void MallocChecker::evalEndPath(GREndPathNodeBuilder &B, void *tag, - GRExprEngine &Eng) { +void MallocChecker::evalEndPath(EndPathNodeBuilder &B, void *tag, + ExprEngine &Eng) { SaveAndRestore<bool> OldHasGen(B.HasGeneratedNode); const GRState *state = B.getState(); RegionStateTy M = state->get<RegionState>(); diff --git a/clang/lib/GR/Checkers/NSAutoreleasePoolChecker.cpp b/clang/lib/GR/Checkers/NSAutoreleasePoolChecker.cpp index d6701c7142c..beb4a81743b 100644 --- a/clang/lib/GR/Checkers/NSAutoreleasePoolChecker.cpp +++ b/clang/lib/GR/Checkers/NSAutoreleasePoolChecker.cpp @@ -16,7 +16,7 @@ //===----------------------------------------------------------------------===// #include "clang/GR/BugReporter/BugReporter.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" #include "BasicObjCFoundationChecks.h" #include "clang/AST/DeclObjC.h" @@ -45,7 +45,7 @@ public: } // end anonymous namespace -void GR::RegisterNSAutoreleasePoolChecks(GRExprEngine &Eng) { +void GR::RegisterNSAutoreleasePoolChecks(ExprEngine &Eng) { ASTContext &Ctx = Eng.getContext(); if (Ctx.getLangOptions().getGCMode() != LangOptions::NonGC) { Eng.registerCheck(new NSAutoreleasePoolChecker(GetNullarySelector("release", diff --git a/clang/lib/GR/Checkers/NSErrorChecker.cpp b/clang/lib/GR/Checkers/NSErrorChecker.cpp index 44715bf9f94..3cfb044d6f8 100644 --- a/clang/lib/GR/Checkers/NSErrorChecker.cpp +++ b/clang/lib/GR/Checkers/NSErrorChecker.cpp @@ -17,7 +17,7 @@ #include "clang/GR/Checkers/LocalCheckers.h" #include "clang/GR/BugReporter/BugType.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" #include "clang/GR/Checkers/DereferenceChecker.h" #include "BasicObjCFoundationChecks.h" #include "clang/AST/DeclObjC.h" @@ -32,7 +32,7 @@ class NSErrorChecker : public BugType { const Decl &CodeDecl; const bool isNSErrorWarning; IdentifierInfo * const II; - GRExprEngine &Eng; + ExprEngine &Eng; void CheckSignature(const ObjCMethodDecl& MD, QualType& ResultTy, llvm::SmallVectorImpl<VarDecl*>& ErrorParams); @@ -49,7 +49,7 @@ class NSErrorChecker : public BugType { void EmitRetTyWarning(BugReporter& BR, const Decl& CodeDecl); public: - NSErrorChecker(const Decl &D, bool isNSError, GRExprEngine& eng) + NSErrorChecker(const Decl &D, bool isNSError, ExprEngine& eng) : BugType(isNSError ? "NSError** null dereference" : "CFErrorRef* null dereference", "Coding conventions (Apple)"), @@ -63,7 +63,7 @@ public: } // end anonymous namespace -void GR::RegisterNSErrorChecks(BugReporter& BR, GRExprEngine &Eng, +void GR::RegisterNSErrorChecks(BugReporter& BR, ExprEngine &Eng, const Decl &D) { BR.Register(new NSErrorChecker(D, true, Eng)); BR.Register(new NSErrorChecker(D, false, Eng)); diff --git a/clang/lib/GR/Checkers/NoReturnFunctionChecker.cpp b/clang/lib/GR/Checkers/NoReturnFunctionChecker.cpp index 739460f781d..f6d33dbda8d 100644 --- a/clang/lib/GR/Checkers/NoReturnFunctionChecker.cpp +++ b/clang/lib/GR/Checkers/NoReturnFunctionChecker.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" #include "llvm/ADT/StringSwitch.h" @@ -29,7 +29,7 @@ public: } -void GR::RegisterNoReturnFunctionChecker(GRExprEngine &Eng) { +void GR::RegisterNoReturnFunctionChecker(ExprEngine &Eng) { Eng.registerCheck(new NoReturnFunctionChecker()); } diff --git a/clang/lib/GR/Checkers/OSAtomicChecker.cpp b/clang/lib/GR/Checkers/OSAtomicChecker.cpp index 7df7a9eec04..c27e50880e1 100644 --- a/clang/lib/GR/Checkers/OSAtomicChecker.cpp +++ b/clang/lib/GR/Checkers/OSAtomicChecker.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/PathSensitive/Checker.h" #include "clang/Basic/Builtins.h" @@ -31,7 +31,7 @@ private: } -void GR::RegisterOSAtomicChecker(GRExprEngine &Eng) { +void GR::RegisterOSAtomicChecker(ExprEngine &Eng) { Eng.registerCheck(new OSAtomicChecker()); } @@ -97,7 +97,7 @@ bool OSAtomicChecker::evalOSAtomicCompareAndSwap(CheckerContext &C, const void *OSAtomicStoreTag = &magic_store; // Load 'theValue'. - GRExprEngine &Engine = C.getEngine(); + ExprEngine &Engine = C.getEngine(); const GRState *state = C.getState(); ExplodedNodeSet Tmp; SVal location = state->getSVal(theValueExpr); diff --git a/clang/lib/GR/Checkers/ObjCAtSyncChecker.cpp b/clang/lib/GR/Checkers/ObjCAtSyncChecker.cpp index a3938627b1f..40619a2a853 100644 --- a/clang/lib/GR/Checkers/ObjCAtSyncChecker.cpp +++ b/clang/lib/GR/Checkers/ObjCAtSyncChecker.cpp @@ -12,11 +12,11 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/Checkers/DereferenceChecker.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" using namespace clang; using namespace GR; @@ -33,7 +33,7 @@ public: }; } // end anonymous namespace -void GR::RegisterObjCAtSyncChecker(GRExprEngine &Eng) { +void GR::RegisterObjCAtSyncChecker(ExprEngine &Eng) { // @synchronized is an Objective-C 2 feature. if (Eng.getContext().getLangOptions().ObjC2) Eng.registerCheck(new ObjCAtSyncChecker()); diff --git a/clang/lib/GR/Checkers/PointerArithChecker.cpp b/clang/lib/GR/Checkers/PointerArithChecker.cpp index 485144a1421..1f870052c16 100644 --- a/clang/lib/GR/Checkers/PointerArithChecker.cpp +++ b/clang/lib/GR/Checkers/PointerArithChecker.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" @@ -67,6 +67,6 @@ void PointerArithChecker::PreVisitBinaryOperator(CheckerContext &C, } } -void GR::RegisterPointerArithChecker(GRExprEngine &Eng) { +void GR::RegisterPointerArithChecker(ExprEngine &Eng) { Eng.registerCheck(new PointerArithChecker()); } diff --git a/clang/lib/GR/Checkers/PointerSubChecker.cpp b/clang/lib/GR/Checkers/PointerSubChecker.cpp index 44e3d9f0090..57ab31803ce 100644 --- a/clang/lib/GR/Checkers/PointerSubChecker.cpp +++ b/clang/lib/GR/Checkers/PointerSubChecker.cpp @@ -13,7 +13,7 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" @@ -74,6 +74,6 @@ void PointerSubChecker::PreVisitBinaryOperator(CheckerContext &C, } } -void GR::RegisterPointerSubChecker(GRExprEngine &Eng) { +void GR::RegisterPointerSubChecker(ExprEngine &Eng) { Eng.registerCheck(new PointerSubChecker()); } diff --git a/clang/lib/GR/Checkers/PthreadLockChecker.cpp b/clang/lib/GR/Checkers/PthreadLockChecker.cpp index d880b066bc8..ae58b78fb8a 100644 --- a/clang/lib/GR/Checkers/PthreadLockChecker.cpp +++ b/clang/lib/GR/Checkers/PthreadLockChecker.cpp @@ -8,14 +8,14 @@ //===----------------------------------------------------------------------===// // // This defines PthreadLockChecker, a simple lock -> unlock checker. Eventually -// this shouldn't be registered with GRExprEngineInternalChecks. +// this shouldn't be registered with ExprEngineInternalChecks. // //===----------------------------------------------------------------------===// #include "clang/GR/PathSensitive/CheckerVisitor.h" #include "clang/GR/BugReporter/BugReporter.h" #include "clang/GR/PathSensitive/GRStateTrait.h" -#include "GRExprEngineExperimentalChecks.h" +#include "ExprEngineExperimentalChecks.h" #include "llvm/ADT/ImmutableSet.h" using namespace clang; @@ -53,7 +53,7 @@ template <> struct GRStateTrait<LockSet> : } // end GR namespace } // end clang namespace -void GR::RegisterPthreadLockChecker(GRExprEngine &Eng) { +void GR::RegisterPthreadLockChecker(ExprEngine &Eng) { Eng.registerCheck(new PthreadLockChecker()); } diff --git a/clang/lib/GR/Checkers/ReturnPointerRangeChecker.cpp b/clang/lib/GR/Checkers/ReturnPointerRangeChecker.cpp index 98b4ea544d7..4ef5737f354 100644 --- a/clang/lib/GR/Checkers/ReturnPointerRangeChecker.cpp +++ b/clang/lib/GR/Checkers/ReturnPointerRangeChecker.cpp @@ -12,10 +12,10 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" using namespace clang; using namespace GR; @@ -31,7 +31,7 @@ public: }; } -void GR::RegisterReturnPointerRangeChecker(GRExprEngine &Eng) { +void GR::RegisterReturnPointerRangeChecker(ExprEngine &Eng) { Eng.registerCheck(new ReturnPointerRangeChecker()); } diff --git a/clang/lib/GR/Checkers/ReturnUndefChecker.cpp b/clang/lib/GR/Checkers/ReturnUndefChecker.cpp index addae5b1c01..2a1027a9301 100644 --- a/clang/lib/GR/Checkers/ReturnUndefChecker.cpp +++ b/clang/lib/GR/Checkers/ReturnUndefChecker.cpp @@ -13,10 +13,10 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" using namespace clang; using namespace GR; @@ -32,7 +32,7 @@ public: }; } -void GR::RegisterReturnUndefChecker(GRExprEngine &Eng) { +void GR::RegisterReturnUndefChecker(ExprEngine &Eng) { Eng.registerCheck(new ReturnUndefChecker()); } diff --git a/clang/lib/GR/Checkers/StackAddrLeakChecker.cpp b/clang/lib/GR/Checkers/StackAddrLeakChecker.cpp index 87f5819cf7e..3ef78a46fb1 100644 --- a/clang/lib/GR/Checkers/StackAddrLeakChecker.cpp +++ b/clang/lib/GR/Checkers/StackAddrLeakChecker.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" #include "clang/GR/PathSensitive/GRState.h" @@ -33,7 +33,7 @@ public: return &x; } void PreVisitReturnStmt(CheckerContext &C, const ReturnStmt *RS); - void evalEndPath(GREndPathNodeBuilder &B, void *tag, GRExprEngine &Eng); + void evalEndPath(EndPathNodeBuilder &B, void *tag, ExprEngine &Eng); private: void EmitStackError(CheckerContext &C, const MemRegion *R, const Expr *RetE); SourceRange GenName(llvm::raw_ostream &os, const MemRegion *R, @@ -41,7 +41,7 @@ private: }; } -void GR::RegisterStackAddrLeakChecker(GRExprEngine &Eng) { +void GR::RegisterStackAddrLeakChecker(ExprEngine &Eng) { Eng.registerCheck(new StackAddrLeakChecker()); } @@ -130,8 +130,8 @@ void StackAddrLeakChecker::PreVisitReturnStmt(CheckerContext &C, } } -void StackAddrLeakChecker::evalEndPath(GREndPathNodeBuilder &B, void *tag, - GRExprEngine &Eng) { +void StackAddrLeakChecker::evalEndPath(EndPathNodeBuilder &B, void *tag, + ExprEngine &Eng) { SaveAndRestore<bool> OldHasGen(B.HasGeneratedNode); const GRState *state = B.getState(); diff --git a/clang/lib/GR/Checkers/StreamChecker.cpp b/clang/lib/GR/Checkers/StreamChecker.cpp index 01186b52dfc..73c2920ad94 100644 --- a/clang/lib/GR/Checkers/StreamChecker.cpp +++ b/clang/lib/GR/Checkers/StreamChecker.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineExperimentalChecks.h" +#include "ExprEngineExperimentalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" #include "clang/GR/PathSensitive/GRState.h" @@ -75,7 +75,7 @@ public: virtual bool evalCallExpr(CheckerContext &C, const CallExpr *CE); void evalDeadSymbols(CheckerContext &C, SymbolReaper &SymReaper); - void evalEndPath(GREndPathNodeBuilder &B, void *tag, GRExprEngine &Eng); + void evalEndPath(EndPathNodeBuilder &B, void *tag, ExprEngine &Eng); void PreVisitReturnStmt(CheckerContext &C, const ReturnStmt *S); private: @@ -114,7 +114,7 @@ namespace GR { } } -void GR::RegisterStreamChecker(GRExprEngine &Eng) { +void GR::RegisterStreamChecker(ExprEngine &Eng) { Eng.registerCheck(new StreamChecker()); } @@ -421,8 +421,8 @@ void StreamChecker::evalDeadSymbols(CheckerContext &C,SymbolReaper &SymReaper) { } } -void StreamChecker::evalEndPath(GREndPathNodeBuilder &B, void *tag, - GRExprEngine &Eng) { +void StreamChecker::evalEndPath(EndPathNodeBuilder &B, void *tag, + ExprEngine &Eng) { SaveAndRestore<bool> OldHasGen(B.HasGeneratedNode); const GRState *state = B.getState(); typedef llvm::ImmutableMap<SymbolRef, StreamState> SymMap; diff --git a/clang/lib/GR/Checkers/UndefBranchChecker.cpp b/clang/lib/GR/Checkers/UndefBranchChecker.cpp index fa3dfa59351..e999d8bc132 100644 --- a/clang/lib/GR/Checkers/UndefBranchChecker.cpp +++ b/clang/lib/GR/Checkers/UndefBranchChecker.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/Checker.h" @@ -50,13 +50,13 @@ class UndefBranchChecker : public Checker { public: UndefBranchChecker() : BT(0) {} static void *getTag(); - void VisitBranchCondition(GRBranchNodeBuilder &Builder, GRExprEngine &Eng, + void VisitBranchCondition(BranchNodeBuilder &Builder, ExprEngine &Eng, const Stmt *Condition, void *tag); }; } -void GR::RegisterUndefBranchChecker(GRExprEngine &Eng) { +void GR::RegisterUndefBranchChecker(ExprEngine &Eng) { Eng.registerCheck(new UndefBranchChecker()); } @@ -65,8 +65,8 @@ void *UndefBranchChecker::getTag() { return &x; } -void UndefBranchChecker::VisitBranchCondition(GRBranchNodeBuilder &Builder, - GRExprEngine &Eng, +void UndefBranchChecker::VisitBranchCondition(BranchNodeBuilder &Builder, + ExprEngine &Eng, const Stmt *Condition, void *tag){ const GRState *state = Builder.getState(); SVal X = state->getSVal(Condition); diff --git a/clang/lib/GR/Checkers/UndefCapturedBlockVarChecker.cpp b/clang/lib/GR/Checkers/UndefCapturedBlockVarChecker.cpp index 8a1c285c173..2b45c95843e 100644 --- a/clang/lib/GR/Checkers/UndefCapturedBlockVarChecker.cpp +++ b/clang/lib/GR/Checkers/UndefCapturedBlockVarChecker.cpp @@ -11,9 +11,9 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" #include "clang/GR/BugReporter/BugType.h" #include "llvm/Support/raw_ostream.h" @@ -32,7 +32,7 @@ public: }; } // end anonymous namespace -void GR::RegisterUndefCapturedBlockVarChecker(GRExprEngine &Eng) { +void GR::RegisterUndefCapturedBlockVarChecker(ExprEngine &Eng) { Eng.registerCheck(new UndefCapturedBlockVarChecker()); } diff --git a/clang/lib/GR/Checkers/UndefResultChecker.cpp b/clang/lib/GR/Checkers/UndefResultChecker.cpp index f4d30354e83..348573d21c6 100644 --- a/clang/lib/GR/Checkers/UndefResultChecker.cpp +++ b/clang/lib/GR/Checkers/UndefResultChecker.cpp @@ -7,15 +7,15 @@ // //===----------------------------------------------------------------------===// // -// This defines UndefResultChecker, a builtin check in GRExprEngine that +// This defines UndefResultChecker, a builtin check in ExprEngine that // performs checks for undefined results of non-assignment binary operators. // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" using namespace clang; using namespace GR; @@ -33,7 +33,7 @@ public: }; } // end anonymous namespace -void GR::RegisterUndefResultChecker(GRExprEngine &Eng) { +void GR::RegisterUndefResultChecker(ExprEngine &Eng) { Eng.registerCheck(new UndefResultChecker()); } diff --git a/clang/lib/GR/Checkers/UndefinedArraySubscriptChecker.cpp b/clang/lib/GR/Checkers/UndefinedArraySubscriptChecker.cpp index 8946de39981..0a3cee43a12 100644 --- a/clang/lib/GR/Checkers/UndefinedArraySubscriptChecker.cpp +++ b/clang/lib/GR/Checkers/UndefinedArraySubscriptChecker.cpp @@ -7,12 +7,12 @@ // //===----------------------------------------------------------------------===// // -// This defines UndefinedArraySubscriptChecker, a builtin check in GRExprEngine +// This defines UndefinedArraySubscriptChecker, a builtin check in ExprEngine // that performs checks for undefined array subscripts. // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" @@ -34,7 +34,7 @@ public: }; } // end anonymous namespace -void GR::RegisterUndefinedArraySubscriptChecker(GRExprEngine &Eng) { +void GR::RegisterUndefinedArraySubscriptChecker(ExprEngine &Eng) { Eng.registerCheck(new UndefinedArraySubscriptChecker()); } diff --git a/clang/lib/GR/Checkers/UndefinedAssignmentChecker.cpp b/clang/lib/GR/Checkers/UndefinedAssignmentChecker.cpp index b1eb38704bc..fa43350da8f 100644 --- a/clang/lib/GR/Checkers/UndefinedAssignmentChecker.cpp +++ b/clang/lib/GR/Checkers/UndefinedAssignmentChecker.cpp @@ -7,12 +7,12 @@ // //===----------------------------------------------------------------------===// // -// This defines UndefinedAssginmentChecker, a builtin check in GRExprEngine that +// This defines UndefinedAssginmentChecker, a builtin check in ExprEngine that // checks for assigning undefined values. // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" @@ -31,7 +31,7 @@ public: }; } -void GR::RegisterUndefinedAssignmentChecker(GRExprEngine &Eng){ +void GR::RegisterUndefinedAssignmentChecker(ExprEngine &Eng){ Eng.registerCheck(new UndefinedAssignmentChecker()); } diff --git a/clang/lib/GR/Checkers/UnixAPIChecker.cpp b/clang/lib/GR/Checkers/UnixAPIChecker.cpp index f4c75f76ab6..c365e3042dd 100644 --- a/clang/lib/GR/Checkers/UnixAPIChecker.cpp +++ b/clang/lib/GR/Checkers/UnixAPIChecker.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/Basic/TargetInfo.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" @@ -46,7 +46,7 @@ public: }; } //end anonymous namespace -void GR::RegisterUnixAPIChecker(GRExprEngine &Eng) { +void GR::RegisterUnixAPIChecker(ExprEngine &Eng) { Eng.registerCheck(new UnixAPIChecker()); } @@ -74,7 +74,7 @@ static void CheckOpen(CheckerContext &C, UnixAPIChecker &UC, else { // FIXME: We need a more general way of getting the O_CREAT value. // We could possibly grovel through the preprocessor state, but - // that would require passing the Preprocessor object to the GRExprEngine. + // that would require passing the Preprocessor object to the ExprEngine. return; } } diff --git a/clang/lib/GR/Checkers/UnreachableCodeChecker.cpp b/clang/lib/GR/Checkers/UnreachableCodeChecker.cpp index 0ab97c27d9c..97a2ff56af1 100644 --- a/clang/lib/GR/Checkers/UnreachableCodeChecker.cpp +++ b/clang/lib/GR/Checkers/UnreachableCodeChecker.cpp @@ -21,7 +21,7 @@ #include "clang/GR/PathSensitive/SVals.h" #include "clang/GR/PathSensitive/CheckerHelpers.h" #include "clang/GR/BugReporter/BugReporter.h" -#include "GRExprEngineExperimentalChecks.h" +#include "ExprEngineExperimentalChecks.h" #include "llvm/ADT/SmallPtrSet.h" // The number of CFGBlock pointers we want to reserve memory for. This is used @@ -37,7 +37,7 @@ public: static void *getTag(); void VisitEndAnalysis(ExplodedGraph &G, BugReporter &B, - GRExprEngine &Eng); + ExprEngine &Eng); private: static inline const Stmt *getUnreachableStmt(const CFGBlock *CB); void FindUnreachableEntryPoints(const CFGBlock *CB); @@ -54,13 +54,13 @@ void *UnreachableCodeChecker::getTag() { return &x; } -void GR::RegisterUnreachableCodeChecker(GRExprEngine &Eng) { +void GR::RegisterUnreachableCodeChecker(ExprEngine &Eng) { Eng.registerCheck(new UnreachableCodeChecker()); } void UnreachableCodeChecker::VisitEndAnalysis(ExplodedGraph &G, BugReporter &B, - GRExprEngine &Eng) { + ExprEngine &Eng) { // Bail out if we didn't cover all paths if (Eng.hasWorkRemaining()) return; diff --git a/clang/lib/GR/Checkers/VLASizeChecker.cpp b/clang/lib/GR/Checkers/VLASizeChecker.cpp index d4e9d353398..b2ca2db02f2 100644 --- a/clang/lib/GR/Checkers/VLASizeChecker.cpp +++ b/clang/lib/GR/Checkers/VLASizeChecker.cpp @@ -7,18 +7,18 @@ // //===----------------------------------------------------------------------===// // -// This defines VLASizeChecker, a builtin check in GRExprEngine that +// This defines VLASizeChecker, a builtin check in ExprEngine that // performs checks for declaration of VLA of undefined or zero size. // In addition, VLASizeChecker is responsible for defining the extent // of the MemRegion that represents a VLA. // //===----------------------------------------------------------------------===// -#include "GRExprEngineInternalChecks.h" +#include "ExprEngineInternalChecks.h" #include "clang/AST/CharUnits.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/CheckerVisitor.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" using namespace clang; using namespace GR; @@ -35,7 +35,7 @@ public: }; } // end anonymous namespace -void GR::RegisterVLASizeChecker(GRExprEngine &Eng) { +void GR::RegisterVLASizeChecker(ExprEngine &Eng) { Eng.registerCheck(new VLASizeChecker()); } diff --git a/clang/lib/GR/GRCoreEngine.cpp b/clang/lib/GR/CoreEngine.cpp index 092cb460aef..a086c912351 100644 --- a/clang/lib/GR/GRCoreEngine.cpp +++ b/clang/lib/GR/CoreEngine.cpp @@ -1,4 +1,4 @@ -//==- GRCoreEngine.cpp - Path-Sensitive Dataflow Engine ------------*- C++ -*-// +//==- CoreEngine.cpp - Path-Sensitive Dataflow Engine ------------*- C++ -*-// // // The LLVM Compiler Infrastructure // @@ -13,8 +13,8 @@ //===----------------------------------------------------------------------===// #include "clang/GR/PathSensitive/AnalysisManager.h" -#include "clang/GR/PathSensitive/GRCoreEngine.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/CoreEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" #include "clang/Index/TranslationUnit.h" #include "clang/AST/Expr.h" #include "llvm/Support/Casting.h" @@ -30,7 +30,7 @@ using namespace GR; // This should be removed in the future. namespace clang { namespace GR { -GRTransferFuncs* MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled, +TransferFuncs* MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled, const LangOptions& lopts); } } @@ -39,29 +39,29 @@ GRTransferFuncs* MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled, // Worklist classes for exploration of reachable states. //===----------------------------------------------------------------------===// -GRWorkList::Visitor::~Visitor() {} +WorkList::Visitor::~Visitor() {} namespace { -class DFS : public GRWorkList { - llvm::SmallVector<GRWorkListUnit,20> Stack; +class DFS : public WorkList { + llvm::SmallVector<WorkListUnit,20> Stack; public: virtual bool hasWork() const { return !Stack.empty(); } - virtual void Enqueue(const GRWorkListUnit& U) { + virtual void Enqueue(const WorkListUnit& U) { Stack.push_back(U); } - virtual GRWorkListUnit Dequeue() { + virtual WorkListUnit Dequeue() { assert (!Stack.empty()); - const GRWorkListUnit& U = Stack.back(); + const WorkListUnit& U = Stack.back(); Stack.pop_back(); // This technically "invalidates" U, but we are fine. return U; } virtual bool VisitItemsInWorkList(Visitor &V) { - for (llvm::SmallVectorImpl<GRWorkListUnit>::iterator + for (llvm::SmallVectorImpl<WorkListUnit>::iterator I = Stack.begin(), E = Stack.end(); I != E; ++I) { if (V.Visit(*I)) return true; @@ -70,25 +70,25 @@ public: } }; -class BFS : public GRWorkList { - std::deque<GRWorkListUnit> Queue; +class BFS : public WorkList { + std::deque<WorkListUnit> Queue; public: virtual bool hasWork() const { return !Queue.empty(); } - virtual void Enqueue(const GRWorkListUnit& U) { + virtual void Enqueue(const WorkListUnit& U) { Queue.push_front(U); } - virtual GRWorkListUnit Dequeue() { - GRWorkListUnit U = Queue.front(); + virtual WorkListUnit Dequeue() { + WorkListUnit U = Queue.front(); Queue.pop_front(); return U; } virtual bool VisitItemsInWorkList(Visitor &V) { - for (std::deque<GRWorkListUnit>::iterator + for (std::deque<WorkListUnit>::iterator I = Queue.begin(), E = Queue.end(); I != E; ++I) { if (V.Visit(*I)) return true; @@ -99,33 +99,33 @@ public: } // end anonymous namespace -// Place the dstor for GRWorkList here because it contains virtual member +// Place the dstor for WorkList here because it contains virtual member // functions, and we the code for the dstor generated in one compilation unit. -GRWorkList::~GRWorkList() {} +WorkList::~WorkList() {} -GRWorkList *GRWorkList::MakeDFS() { return new DFS(); } -GRWorkList *GRWorkList::MakeBFS() { return new BFS(); } +WorkList *WorkList::MakeDFS() { return new DFS(); } +WorkList *WorkList::MakeBFS() { return new BFS(); } namespace { - class BFSBlockDFSContents : public GRWorkList { - std::deque<GRWorkListUnit> Queue; - llvm::SmallVector<GRWorkListUnit,20> Stack; + class BFSBlockDFSContents : public WorkList { + std::deque<WorkListUnit> Queue; + llvm::SmallVector<WorkListUnit,20> Stack; public: virtual bool hasWork() const { return !Queue.empty() || !Stack.empty(); } - virtual void Enqueue(const GRWorkListUnit& U) { + virtual void Enqueue(const WorkListUnit& U) { if (isa<BlockEntrance>(U.getNode()->getLocation())) Queue.push_front(U); else Stack.push_back(U); } - virtual GRWorkListUnit Dequeue() { + virtual WorkListUnit Dequeue() { // Process all basic blocks to completion. if (!Stack.empty()) { - const GRWorkListUnit& U = Stack.back(); + const WorkListUnit& U = Stack.back(); Stack.pop_back(); // This technically "invalidates" U, but we are fine. return U; } @@ -133,17 +133,17 @@ namespace { assert(!Queue.empty()); // Don't use const reference. The subsequent pop_back() might make it // unsafe. - GRWorkListUnit U = Queue.front(); + WorkListUnit U = Queue.front(); Queue.pop_front(); return U; } virtual bool VisitItemsInWorkList(Visitor &V) { - for (llvm::SmallVectorImpl<GRWorkListUnit>::iterator + for (llvm::SmallVectorImpl<WorkListUnit>::iterator I = Stack.begin(), E = Stack.end(); I != E; ++I) { if (V.Visit(*I)) return true; } - for (std::deque<GRWorkListUnit>::iterator + for (std::deque<WorkListUnit>::iterator I = Queue.begin(), E = Queue.end(); I != E; ++I) { if (V.Visit(*I)) return true; @@ -154,7 +154,7 @@ namespace { }; } // end anonymous namespace -GRWorkList* GRWorkList::MakeBFSBlockDFSContents() { +WorkList* WorkList::MakeBFSBlockDFSContents() { return new BFSBlockDFSContents(); } @@ -163,7 +163,7 @@ GRWorkList* GRWorkList::MakeBFSBlockDFSContents() { //===----------------------------------------------------------------------===// /// ExecuteWorkList - Run the worklist algorithm for a maximum number of steps. -bool GRCoreEngine::ExecuteWorkList(const LocationContext *L, unsigned Steps, +bool CoreEngine::ExecuteWorkList(const LocationContext *L, unsigned Steps, const GRState *InitState) { if (G->num_roots() == 0) { // Initialize the analysis by constructing @@ -204,7 +204,7 @@ bool GRCoreEngine::ExecuteWorkList(const LocationContext *L, unsigned Steps, --Steps; } - const GRWorkListUnit& WU = WList->Dequeue(); + const WorkListUnit& WU = WList->Dequeue(); // Set the current block counter. WList->setBlockCounter(WU.getBlockCounter()); @@ -243,11 +243,11 @@ bool GRCoreEngine::ExecuteWorkList(const LocationContext *L, unsigned Steps, } } - SubEngine.ProcessEndWorklist(hasWorkRemaining()); + SubEng.ProcessEndWorklist(hasWorkRemaining()); return WList->hasWork(); } -void GRCoreEngine::ExecuteWorkListWithInitialState(const LocationContext *L, +void CoreEngine::ExecuteWorkListWithInitialState(const LocationContext *L, unsigned Steps, const GRState *InitState, ExplodedNodeSet &Dst) { @@ -258,19 +258,19 @@ void GRCoreEngine::ExecuteWorkListWithInitialState(const LocationContext *L, } } -void GRCoreEngine::HandleCallEnter(const CallEnter &L, const CFGBlock *Block, +void CoreEngine::HandleCallEnter(const CallEnter &L, const CFGBlock *Block, unsigned Index, ExplodedNode *Pred) { - GRCallEnterNodeBuilder Builder(*this, Pred, L.getCallExpr(), + CallEnterNodeBuilder Builder(*this, Pred, L.getCallExpr(), L.getCalleeContext(), Block, Index); ProcessCallEnter(Builder); } -void GRCoreEngine::HandleCallExit(const CallExit &L, ExplodedNode *Pred) { - GRCallExitNodeBuilder Builder(*this, Pred); +void CoreEngine::HandleCallExit(const CallExit &L, ExplodedNode *Pred) { + CallExitNodeBuilder Builder(*this, Pred); ProcessCallExit(Builder); } -void GRCoreEngine::HandleBlockEdge(const BlockEdge& L, ExplodedNode* Pred) { +void CoreEngine::HandleBlockEdge(const BlockEdge& L, ExplodedNode* Pred) { const CFGBlock* Blk = L.getDst(); @@ -281,7 +281,7 @@ void GRCoreEngine::HandleBlockEdge(const BlockEdge& L, ExplodedNode* Pred) { && "EXIT block cannot contain Stmts."); // Process the final state transition. - GREndPathNodeBuilder Builder(Blk, Pred, this); + EndPathNodeBuilder Builder(Blk, Pred, this); ProcessEndPath(Builder); // This path is done. Don't enqueue any more nodes. @@ -298,11 +298,11 @@ void GRCoreEngine::HandleBlockEdge(const BlockEdge& L, ExplodedNode* Pred) { } } -void GRCoreEngine::HandleBlockEntrance(const BlockEntrance& L, +void CoreEngine::HandleBlockEntrance(const BlockEntrance& L, ExplodedNode* Pred) { // Increment the block counter. - GRBlockCounter Counter = WList->getBlockCounter(); + BlockCounter Counter = WList->getBlockCounter(); Counter = BCounterFactory.IncrementCount(Counter, Pred->getLocationContext()->getCurrentStackFrame(), L.getBlock()->getBlockID()); @@ -310,15 +310,15 @@ void GRCoreEngine::HandleBlockEntrance(const BlockEntrance& L, // Process the entrance of the block. if (CFGElement E = L.getFirstElement()) { - GRStmtNodeBuilder Builder(L.getBlock(), 0, Pred, this, - SubEngine.getStateManager()); + StmtNodeBuilder Builder(L.getBlock(), 0, Pred, this, + SubEng.getStateManager()); ProcessElement(E, Builder); } else HandleBlockExit(L.getBlock(), Pred); } -void GRCoreEngine::HandleBlockExit(const CFGBlock * B, ExplodedNode* Pred) { +void CoreEngine::HandleBlockExit(const CFGBlock * B, ExplodedNode* Pred) { if (const Stmt* Term = B->getTerminator()) { switch (Term->getStmtClass()) { @@ -362,7 +362,7 @@ void GRCoreEngine::HandleBlockExit(const CFGBlock * B, ExplodedNode* Pred) { // Only 1 successor: the indirect goto dispatch block. assert (B->succ_size() == 1); - GRIndirectGotoNodeBuilder + IndirectGotoNodeBuilder builder(Pred, B, cast<IndirectGotoStmt>(Term)->getTarget(), *(B->succ_begin()), this); @@ -386,7 +386,7 @@ void GRCoreEngine::HandleBlockExit(const CFGBlock * B, ExplodedNode* Pred) { } case Stmt::SwitchStmtClass: { - GRSwitchNodeBuilder builder(Pred, B, cast<SwitchStmt>(Term)->getCond(), + SwitchNodeBuilder builder(Pred, B, cast<SwitchStmt>(Term)->getCond(), this); ProcessSwitch(builder); @@ -406,33 +406,33 @@ void GRCoreEngine::HandleBlockExit(const CFGBlock * B, ExplodedNode* Pred) { Pred->State, Pred); } -void GRCoreEngine::HandleBranch(const Stmt* Cond, const Stmt* Term, +void CoreEngine::HandleBranch(const Stmt* Cond, const Stmt* Term, const CFGBlock * B, ExplodedNode* Pred) { assert (B->succ_size() == 2); - GRBranchNodeBuilder Builder(B, *(B->succ_begin()), *(B->succ_begin()+1), + BranchNodeBuilder Builder(B, *(B->succ_begin()), *(B->succ_begin()+1), Pred, this); ProcessBranch(Cond, Term, Builder); } -void GRCoreEngine::HandlePostStmt(const CFGBlock* B, unsigned StmtIdx, +void CoreEngine::HandlePostStmt(const CFGBlock* B, unsigned StmtIdx, ExplodedNode* Pred) { assert (!B->empty()); if (StmtIdx == B->size()) HandleBlockExit(B, Pred); else { - GRStmtNodeBuilder Builder(B, StmtIdx, Pred, this, - SubEngine.getStateManager()); + StmtNodeBuilder Builder(B, StmtIdx, Pred, this, + SubEng.getStateManager()); ProcessElement((*B)[StmtIdx], Builder); } } /// generateNode - Utility method to generate nodes, hook up successors, /// and add nodes to the worklist. -void GRCoreEngine::generateNode(const ProgramPoint& Loc, - const GRState* State, ExplodedNode* Pred) { +void CoreEngine::generateNode(const ProgramPoint& Loc, + const GRState* State, ExplodedNode* Pred) { bool IsNew; ExplodedNode* Node = G->getNode(Loc, State, &IsNew); @@ -448,8 +448,8 @@ void GRCoreEngine::generateNode(const ProgramPoint& Loc, if (IsNew) WList->Enqueue(Node); } -GRStmtNodeBuilder::GRStmtNodeBuilder(const CFGBlock* b, unsigned idx, - ExplodedNode* N, GRCoreEngine* e, +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), @@ -458,13 +458,13 @@ GRStmtNodeBuilder::GRStmtNodeBuilder(const CFGBlock* b, unsigned idx, CleanedState = Pred->getState(); } -GRStmtNodeBuilder::~GRStmtNodeBuilder() { +StmtNodeBuilder::~StmtNodeBuilder() { for (DeferredTy::iterator I=Deferred.begin(), E=Deferred.end(); I!=E; ++I) if (!(*I)->isSink()) GenerateAutoTransition(*I); } -void GRStmtNodeBuilder::GenerateAutoTransition(ExplodedNode* N) { +void StmtNodeBuilder::GenerateAutoTransition(ExplodedNode* N) { assert (!N->isSink()); // Check if this node entered a callee. @@ -498,7 +498,7 @@ void GRStmtNodeBuilder::GenerateAutoTransition(ExplodedNode* N) { Eng.WList->Enqueue(Succ, &B, Idx+1); } -ExplodedNode* GRStmtNodeBuilder::MakeNode(ExplodedNodeSet& Dst, const Stmt* S, +ExplodedNode* StmtNodeBuilder::MakeNode(ExplodedNodeSet& Dst, const Stmt* S, ExplodedNode* Pred, const GRState* St, ProgramPoint::Kind K) { @@ -539,7 +539,7 @@ static ProgramPoint GetProgramPoint(const Stmt *S, ProgramPoint::Kind K, } ExplodedNode* -GRStmtNodeBuilder::generateNodeInternal(const Stmt* S, const GRState* state, +StmtNodeBuilder::generateNodeInternal(const Stmt* S, const GRState* state, ExplodedNode* Pred, ProgramPoint::Kind K, const void *tag) { @@ -549,7 +549,7 @@ GRStmtNodeBuilder::generateNodeInternal(const Stmt* S, const GRState* state, } ExplodedNode* -GRStmtNodeBuilder::generateNodeInternal(const ProgramPoint &Loc, +StmtNodeBuilder::generateNodeInternal(const ProgramPoint &Loc, const GRState* State, ExplodedNode* Pred) { bool IsNew; @@ -565,7 +565,7 @@ GRStmtNodeBuilder::generateNodeInternal(const ProgramPoint &Loc, return NULL; } -ExplodedNode* GRBranchNodeBuilder::generateNode(const GRState* State, +ExplodedNode* BranchNodeBuilder::generateNode(const GRState* State, bool branch) { // If the branch has been marked infeasible we should not generate a node. @@ -593,7 +593,7 @@ ExplodedNode* GRBranchNodeBuilder::generateNode(const GRState* State, return NULL; } -GRBranchNodeBuilder::~GRBranchNodeBuilder() { +BranchNodeBuilder::~BranchNodeBuilder() { if (!GeneratedTrue) generateNode(Pred->State, true); if (!GeneratedFalse) generateNode(Pred->State, false); @@ -603,7 +603,7 @@ GRBranchNodeBuilder::~GRBranchNodeBuilder() { ExplodedNode* -GRIndirectGotoNodeBuilder::generateNode(const iterator& I, const GRState* St, +IndirectGotoNodeBuilder::generateNode(const iterator& I, const GRState* St, bool isSink) { bool IsNew; @@ -627,7 +627,7 @@ GRIndirectGotoNodeBuilder::generateNode(const iterator& I, const GRState* St, ExplodedNode* -GRSwitchNodeBuilder::generateCaseStmtNode(const iterator& I, const GRState* St){ +SwitchNodeBuilder::generateCaseStmtNode(const iterator& I, const GRState* St){ bool IsNew; @@ -645,7 +645,7 @@ GRSwitchNodeBuilder::generateCaseStmtNode(const iterator& I, const GRState* St){ ExplodedNode* -GRSwitchNodeBuilder::generateDefaultCaseNode(const GRState* St, bool isSink) { +SwitchNodeBuilder::generateDefaultCaseNode(const GRState* St, bool isSink) { // Get the block for the default case. assert (Src->succ_rbegin() != Src->succ_rend()); @@ -669,7 +669,7 @@ GRSwitchNodeBuilder::generateDefaultCaseNode(const GRState* St, bool isSink) { return NULL; } -GREndPathNodeBuilder::~GREndPathNodeBuilder() { +EndPathNodeBuilder::~EndPathNodeBuilder() { // Auto-generate an EOP node if one has not been generated. if (!HasGeneratedNode) { // If we are in an inlined call, generate CallExit node. @@ -681,7 +681,7 @@ GREndPathNodeBuilder::~GREndPathNodeBuilder() { } ExplodedNode* -GREndPathNodeBuilder::generateNode(const GRState* State, const void *tag, +EndPathNodeBuilder::generateNode(const GRState* State, const void *tag, ExplodedNode* P) { HasGeneratedNode = true; bool IsNew; @@ -699,7 +699,7 @@ GREndPathNodeBuilder::generateNode(const GRState* State, const void *tag, return NULL; } -void GREndPathNodeBuilder::GenerateCallExitNode(const GRState *state) { +void EndPathNodeBuilder::GenerateCallExitNode(const GRState *state) { HasGeneratedNode = true; // Create a CallExit node and enqueue it. const StackFrameContext *LocCtx @@ -718,14 +718,14 @@ void GREndPathNodeBuilder::GenerateCallExitNode(const GRState *state) { } -void GRCallEnterNodeBuilder::generateNode(const GRState *state) { +void CallEnterNodeBuilder::generateNode(const GRState *state) { // Check if the callee is in the same translation unit. if (CalleeCtx->getTranslationUnit() != Pred->getLocationContext()->getTranslationUnit()) { // Create a new engine. We must be careful that the new engine should not // reference data structures owned by the old engine. - AnalysisManager &OldMgr = Eng.SubEngine.getAnalysisManager(); + AnalysisManager &OldMgr = Eng.SubEng.getAnalysisManager(); // Get the callee's translation unit. idx::TranslationUnit *TU = CalleeCtx->getTranslationUnit(); @@ -749,11 +749,11 @@ void GRCallEnterNodeBuilder::generateNode(const GRState *state) { OldMgr.getAnalysisContextManager().getUseUnoptimizedCFG(), OldMgr.getAnalysisContextManager().getAddImplicitDtors(), OldMgr.getAnalysisContextManager().getAddInitializers()); - llvm::OwningPtr<GRTransferFuncs> TF(MakeCFRefCountTF(AMgr.getASTContext(), + llvm::OwningPtr<TransferFuncs> TF(MakeCFRefCountTF(AMgr.getASTContext(), /* GCEnabled */ false, AMgr.getLangOptions())); // Create the new engine. - GRExprEngine NewEng(AMgr, TF.take()); + ExprEngine NewEng(AMgr, TF.take()); // Create the new LocationContext. AnalysisContext *NewAnaCtx = AMgr.getAnalysisContext(CalleeCtx->getDecl(), @@ -793,7 +793,7 @@ void GRCallEnterNodeBuilder::generateNode(const GRState *state) { Eng.WList->Enqueue(Node); } -void GRCallExitNodeBuilder::generateNode(const GRState *state) { +void CallExitNodeBuilder::generateNode(const GRState *state) { // Get the callee's location context. const StackFrameContext *LocCtx = cast<StackFrameContext>(Pred->getLocationContext()); diff --git a/clang/lib/GR/GRExprEngine.cpp b/clang/lib/GR/ExprEngine.cpp index d6086c76e64..7cf9054f247 100644 --- a/clang/lib/GR/GRExprEngine.cpp +++ b/clang/lib/GR/ExprEngine.cpp @@ -1,4 +1,4 @@ -//=-- GRExprEngine.cpp - Path-Sensitive Expression-Level Dataflow ---*- C++ -*-= +//=-- ExprEngine.cpp - Path-Sensitive Expression-Level Dataflow ---*- C++ -*-= // // The LLVM Compiler Infrastructure // @@ -14,12 +14,12 @@ //===----------------------------------------------------------------------===// // FIXME: Restructure checker registration. -#include "Checkers/GRExprEngineInternalChecks.h" +#include "Checkers/ExprEngineInternalChecks.h" #include "clang/GR/BugReporter/BugType.h" #include "clang/GR/PathSensitive/AnalysisManager.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" -#include "clang/GR/PathSensitive/GRExprEngineBuilders.h" +#include "clang/GR/PathSensitive/ExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngineBuilders.h" #include "clang/GR/PathSensitive/Checker.h" #include "clang/AST/CharUnits.h" #include "clang/AST/ParentMap.h" @@ -65,7 +65,7 @@ static inline Selector GetNullarySelector(const char* name, ASTContext& Ctx) { // Checker worklist routines. //===----------------------------------------------------------------------===// -void GRExprEngine::CheckerVisit(const Stmt *S, ExplodedNodeSet &Dst, +void ExprEngine::CheckerVisit(const Stmt *S, ExplodedNodeSet &Dst, ExplodedNodeSet &Src, CallbackKind Kind) { // Determine if we already have a cached 'CheckersOrdered' vector @@ -145,7 +145,7 @@ void GRExprEngine::CheckerVisit(const Stmt *S, ExplodedNodeSet &Dst, // automatically. } -void GRExprEngine::CheckerEvalNilReceiver(const ObjCMessageExpr *ME, +void ExprEngine::CheckerEvalNilReceiver(const ObjCMessageExpr *ME, ExplodedNodeSet &Dst, const GRState *state, ExplodedNode *Pred) { @@ -174,7 +174,7 @@ void GRExprEngine::CheckerEvalNilReceiver(const ObjCMessageExpr *ME, // CheckerEvalCall returns true if one of the checkers processed the node. // This may return void when all call evaluation logic goes to some checker // in the future. -bool GRExprEngine::CheckerEvalCall(const CallExpr *CE, +bool ExprEngine::CheckerEvalCall(const CallExpr *CE, ExplodedNodeSet &Dst, ExplodedNode *Pred) { bool evaluated = false; @@ -202,7 +202,7 @@ bool GRExprEngine::CheckerEvalCall(const CallExpr *CE, // FIXME: This is largely copy-paste from CheckerVisit(). Need to // unify. -void GRExprEngine::CheckerVisitBind(const Stmt *StoreE, ExplodedNodeSet &Dst, +void ExprEngine::CheckerVisitBind(const Stmt *StoreE, ExplodedNodeSet &Dst, ExplodedNodeSet &Src, SVal location, SVal val, bool isPrevisit) { @@ -243,16 +243,16 @@ void GRExprEngine::CheckerVisitBind(const Stmt *StoreE, ExplodedNodeSet &Dst, // Engine construction and deletion. //===----------------------------------------------------------------------===// -static void RegisterInternalChecks(GRExprEngine &Eng) { +static void RegisterInternalChecks(ExprEngine &Eng) { // Register internal "built-in" BugTypes with the BugReporter. These BugTypes // are different than what probably many checks will do since they don't - // create BugReports on-the-fly but instead wait until GRExprEngine finishes + // create BugReports on-the-fly but instead wait until ExprEngine finishes // analyzing a function. Generation of BugReport objects is done via a call // to 'FlushReports' from BugReporter. // The following checks do not need to have their associated BugTypes // explicitly registered with the BugReporter. If they issue any BugReports, // their associated BugType will get registered with the BugReporter - // automatically. Note that the check itself is owned by the GRExprEngine + // automatically. Note that the check itself is owned by the ExprEngine // object. RegisterAdjustedReturnValueChecker(Eng); // CallAndMessageChecker should be registered before AttrNonNullChecker, @@ -279,10 +279,10 @@ static void RegisterInternalChecks(GRExprEngine &Eng) { RegisterMacOSXAPIChecker(Eng); } -GRExprEngine::GRExprEngine(AnalysisManager &mgr, GRTransferFuncs *tf) +ExprEngine::ExprEngine(AnalysisManager &mgr, TransferFuncs *tf) : AMgr(mgr), - CoreEngine(*this), - G(CoreEngine.getGraph()), + Engine(*this), + G(Engine.getGraph()), Builder(NULL), StateMgr(getContext(), mgr.getStoreManagerCreator(), mgr.getConstraintManagerCreator(), G.getAllocator(), @@ -301,7 +301,7 @@ GRExprEngine::GRExprEngine(AnalysisManager &mgr, GRTransferFuncs *tf) TF->RegisterPrinters(getStateManager().Printers); } -GRExprEngine::~GRExprEngine() { +ExprEngine::~ExprEngine() { BR.FlushReports(); delete [] NSExceptionInstanceRaiseSelectors; @@ -318,7 +318,7 @@ GRExprEngine::~GRExprEngine() { // Utility methods. //===----------------------------------------------------------------------===// -const GRState* GRExprEngine::getInitialState(const LocationContext *InitLoc) { +const GRState* ExprEngine::getInitialState(const LocationContext *InitLoc) { const GRState *state = StateMgr.getInitialState(InitLoc); // Preconditions. @@ -384,7 +384,7 @@ const GRState* GRExprEngine::getInitialState(const LocationContext *InitLoc) { /// evalAssume - Called by ConstraintManager. Used to call checker-specific /// logic for handling assumptions on symbolic values. -const GRState *GRExprEngine::ProcessAssume(const GRState *state, SVal cond, +const GRState *ExprEngine::ProcessAssume(const GRState *state, SVal cond, bool assumption) { // Determine if we already have a cached 'CheckersOrdered' vector // specifically tailored for processing assumptions. This @@ -439,7 +439,7 @@ const GRState *GRExprEngine::ProcessAssume(const GRState *state, SVal cond, return TF->evalAssume(state, cond, assumption); } -bool GRExprEngine::WantsRegionChangeUpdate(const GRState* state) { +bool ExprEngine::WantsRegionChangeUpdate(const GRState* state) { CallbackTag K = GetCallbackTag(EvalRegionChangesCallback); CheckersOrdered *CO = COCache[K]; @@ -456,7 +456,7 @@ bool GRExprEngine::WantsRegionChangeUpdate(const GRState* state) { } const GRState * -GRExprEngine::ProcessRegionChanges(const GRState *state, +ExprEngine::ProcessRegionChanges(const GRState *state, const MemRegion * const *Begin, const MemRegion * const *End) { // FIXME: Most of this method is copy-pasted from ProcessAssume. @@ -508,15 +508,15 @@ GRExprEngine::ProcessRegionChanges(const GRState *state, return state; } -void GRExprEngine::ProcessEndWorklist(bool hasWorkRemaining) { +void ExprEngine::ProcessEndWorklist(bool hasWorkRemaining) { for (CheckersOrdered::iterator I = Checkers.begin(), E = Checkers.end(); I != E; ++I) { I->second->VisitEndAnalysis(G, BR, *this); } } -void GRExprEngine::ProcessElement(const CFGElement E, - GRStmtNodeBuilder& builder) { +void ExprEngine::ProcessElement(const CFGElement E, + StmtNodeBuilder& builder) { switch (E.getKind()) { case CFGElement::Statement: ProcessStmt(E.getAs<CFGStmt>(), builder); @@ -533,7 +533,7 @@ void GRExprEngine::ProcessElement(const CFGElement E, } } -void GRExprEngine::ProcessStmt(const CFGStmt S, GRStmtNodeBuilder& builder) { +void ExprEngine::ProcessStmt(const CFGStmt S, StmtNodeBuilder& builder) { currentStmt = S.getStmt(); PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(), currentStmt->getLocStart(), @@ -619,7 +619,7 @@ void GRExprEngine::ProcessStmt(const CFGStmt S, GRStmtNodeBuilder& builder) { Visit(currentStmt, *I, Dst); // Do we need to auto-generate a node? We only need to do this to generate - // a node with a "cleaned" state; GRCoreEngine will actually handle + // 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) { @@ -637,8 +637,8 @@ void GRExprEngine::ProcessStmt(const CFGStmt S, GRStmtNodeBuilder& builder) { Builder = NULL; } -void GRExprEngine::ProcessInitializer(const CFGInitializer Init, - GRStmtNodeBuilder &builder) { +void ExprEngine::ProcessInitializer(const CFGInitializer Init, + StmtNodeBuilder &builder) { // We don't set EntryNode and currentStmt. And we don't clean up state. const CXXBaseOrMemberInitializer *BMI = Init.getInitializer(); @@ -674,8 +674,8 @@ void GRExprEngine::ProcessInitializer(const CFGInitializer Init, } } -void GRExprEngine::ProcessImplicitDtor(const CFGImplicitDtor D, - GRStmtNodeBuilder &builder) { +void ExprEngine::ProcessImplicitDtor(const CFGImplicitDtor D, + StmtNodeBuilder &builder) { Builder = &builder; switch (D.getDtorKind()) { @@ -696,8 +696,8 @@ void GRExprEngine::ProcessImplicitDtor(const CFGImplicitDtor D, } } -void GRExprEngine::ProcessAutomaticObjDtor(const CFGAutomaticObjDtor dtor, - GRStmtNodeBuilder &builder) { +void ExprEngine::ProcessAutomaticObjDtor(const CFGAutomaticObjDtor dtor, + StmtNodeBuilder &builder) { ExplodedNode *pred = builder.getBasePredecessor(); const GRState *state = pred->getState(); const VarDecl *varDecl = dtor.getVarDecl(); @@ -718,19 +718,19 @@ void GRExprEngine::ProcessAutomaticObjDtor(const CFGAutomaticObjDtor dtor, dtor.getTriggerStmt(), pred, dstSet); } -void GRExprEngine::ProcessBaseDtor(const CFGBaseDtor D, - GRStmtNodeBuilder &builder) { +void ExprEngine::ProcessBaseDtor(const CFGBaseDtor D, + StmtNodeBuilder &builder) { } -void GRExprEngine::ProcessMemberDtor(const CFGMemberDtor D, - GRStmtNodeBuilder &builder) { +void ExprEngine::ProcessMemberDtor(const CFGMemberDtor D, + StmtNodeBuilder &builder) { } -void GRExprEngine::ProcessTemporaryDtor(const CFGTemporaryDtor D, - GRStmtNodeBuilder &builder) { +void ExprEngine::ProcessTemporaryDtor(const CFGTemporaryDtor D, + StmtNodeBuilder &builder) { } -void GRExprEngine::Visit(const Stmt* S, ExplodedNode* Pred, +void ExprEngine::Visit(const Stmt* S, ExplodedNode* Pred, ExplodedNodeSet& Dst) { PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(), S->getLocStart(), @@ -1075,9 +1075,9 @@ void GRExprEngine::Visit(const Stmt* S, ExplodedNode* Pred, // Block entrance. (Update counters). //===----------------------------------------------------------------------===// -bool GRExprEngine::ProcessBlockEntrance(const CFGBlock* B, +bool ExprEngine::ProcessBlockEntrance(const CFGBlock* B, const ExplodedNode *Pred, - GRBlockCounter BC) { + BlockCounter BC) { return BC.getNumVisited(Pred->getLocationContext()->getCurrentStackFrame(), B->getBlockID()) < AMgr.getMaxVisit(); } @@ -1086,10 +1086,10 @@ bool GRExprEngine::ProcessBlockEntrance(const CFGBlock* B, // Generic node creation. //===----------------------------------------------------------------------===// -ExplodedNode* GRExprEngine::MakeNode(ExplodedNodeSet& Dst, const Stmt* S, +ExplodedNode* ExprEngine::MakeNode(ExplodedNodeSet& Dst, const Stmt* S, ExplodedNode* Pred, const GRState* St, ProgramPoint::Kind K, const void *tag) { - assert (Builder && "GRStmtNodeBuilder not present."); + assert (Builder && "StmtNodeBuilder not present."); SaveAndRestore<const void*> OldTag(Builder->Tag); Builder->Tag = tag; return Builder->MakeNode(Dst, S, Pred, St, K); @@ -1099,7 +1099,7 @@ ExplodedNode* GRExprEngine::MakeNode(ExplodedNodeSet& Dst, const Stmt* S, // Branch processing. //===----------------------------------------------------------------------===// -const GRState* GRExprEngine::MarkBranch(const GRState* state, +const GRState* ExprEngine::MarkBranch(const GRState* state, const Stmt* Terminator, bool branchTaken) { @@ -1193,8 +1193,8 @@ static SVal RecoverCastedSymbol(GRStateManager& StateMgr, const GRState* state, return state->getSVal(Ex); } -void GRExprEngine::ProcessBranch(const Stmt* Condition, const Stmt* Term, - GRBranchNodeBuilder& builder) { +void ExprEngine::ProcessBranch(const Stmt* Condition, const Stmt* Term, + BranchNodeBuilder& builder) { // Check for NULL conditions; e.g. "for(;;)" if (!Condition) { @@ -1263,9 +1263,9 @@ void GRExprEngine::ProcessBranch(const Stmt* Condition, const Stmt* Term, } } -/// ProcessIndirectGoto - Called by GRCoreEngine. Used to generate successor +/// ProcessIndirectGoto - Called by CoreEngine. Used to generate successor /// nodes by processing the 'effects' of a computed goto jump. -void GRExprEngine::ProcessIndirectGoto(GRIndirectGotoNodeBuilder& builder) { +void ExprEngine::ProcessIndirectGoto(IndirectGotoNodeBuilder& builder) { const GRState *state = builder.getState(); SVal V = state->getSVal(builder.getTarget()); @@ -1277,7 +1277,7 @@ void GRExprEngine::ProcessIndirectGoto(GRIndirectGotoNodeBuilder& builder) { // (3) We have no clue about the label. Dispatch to all targets. // - typedef GRIndirectGotoNodeBuilder::iterator iterator; + typedef IndirectGotoNodeBuilder::iterator iterator; if (isa<loc::GotoLabel>(V)) { const LabelStmt* L = cast<loc::GotoLabel>(V).getLabel(); @@ -1309,7 +1309,7 @@ void GRExprEngine::ProcessIndirectGoto(GRIndirectGotoNodeBuilder& builder) { } -void GRExprEngine::VisitGuardedExpr(const Expr* Ex, const Expr* L, +void ExprEngine::VisitGuardedExpr(const Expr* Ex, const Expr* L, const Expr* R, ExplodedNode* Pred, ExplodedNodeSet& Dst) { @@ -1329,9 +1329,9 @@ void GRExprEngine::VisitGuardedExpr(const Expr* Ex, const Expr* L, MakeNode(Dst, Ex, Pred, state->BindExpr(Ex, X, true)); } -/// ProcessEndPath - Called by GRCoreEngine. Used to generate end-of-path +/// ProcessEndPath - Called by CoreEngine. Used to generate end-of-path /// nodes when the control reaches the end of a function. -void GRExprEngine::ProcessEndPath(GREndPathNodeBuilder& builder) { +void ExprEngine::ProcessEndPath(EndPathNodeBuilder& builder) { getTF().evalEndPath(*this, builder); StateMgr.EndPath(builder.getState()); for (CheckersOrdered::iterator I=Checkers.begin(),E=Checkers.end(); I!=E;++I){ @@ -1341,10 +1341,10 @@ void GRExprEngine::ProcessEndPath(GREndPathNodeBuilder& builder) { } } -/// ProcessSwitch - Called by GRCoreEngine. Used to generate successor +/// ProcessSwitch - Called by CoreEngine. Used to generate successor /// nodes by processing the 'effects' of a switch statement. -void GRExprEngine::ProcessSwitch(GRSwitchNodeBuilder& builder) { - typedef GRSwitchNodeBuilder::iterator iterator; +void ExprEngine::ProcessSwitch(SwitchNodeBuilder& builder) { + typedef SwitchNodeBuilder::iterator iterator; const GRState* state = builder.getState(); const Expr* CondE = builder.getCondition(); SVal CondV_untested = state->getSVal(CondE); @@ -1452,12 +1452,12 @@ void GRExprEngine::ProcessSwitch(GRSwitchNodeBuilder& builder) { builder.generateDefaultCaseNode(DefaultSt); } -void GRExprEngine::ProcessCallEnter(GRCallEnterNodeBuilder &B) { +void ExprEngine::ProcessCallEnter(CallEnterNodeBuilder &B) { const GRState *state = B.getState()->EnterStackFrame(B.getCalleeContext()); B.generateNode(state); } -void GRExprEngine::ProcessCallExit(GRCallExitNodeBuilder &B) { +void ExprEngine::ProcessCallExit(CallExitNodeBuilder &B) { const GRState *state = B.getState(); const ExplodedNode *Pred = B.getPredecessor(); const StackFrameContext *calleeCtx = @@ -1490,7 +1490,7 @@ void GRExprEngine::ProcessCallExit(GRCallExitNodeBuilder &B) { // Transfer functions: logical operations ('&&', '||'). //===----------------------------------------------------------------------===// -void GRExprEngine::VisitLogicalExpr(const BinaryOperator* B, ExplodedNode* Pred, +void ExprEngine::VisitLogicalExpr(const BinaryOperator* B, ExplodedNode* Pred, ExplodedNodeSet& Dst) { assert(B->getOpcode() == BO_LAnd || @@ -1544,7 +1544,7 @@ void GRExprEngine::VisitLogicalExpr(const BinaryOperator* B, ExplodedNode* Pred, // Transfer functions: Loads and stores. //===----------------------------------------------------------------------===// -void GRExprEngine::VisitBlockExpr(const BlockExpr *BE, ExplodedNode *Pred, +void ExprEngine::VisitBlockExpr(const BlockExpr *BE, ExplodedNode *Pred, ExplodedNodeSet &Dst) { ExplodedNodeSet Tmp; @@ -1560,9 +1560,9 @@ void GRExprEngine::VisitBlockExpr(const BlockExpr *BE, ExplodedNode *Pred, CheckerVisit(BE, Dst, Tmp, PostVisitStmtCallback); } -void GRExprEngine::VisitCommonDeclRefExpr(const Expr *Ex, const NamedDecl *D, - ExplodedNode *Pred, - ExplodedNodeSet &Dst) { +void ExprEngine::VisitCommonDeclRefExpr(const Expr *Ex, const NamedDecl *D, + ExplodedNode *Pred, + ExplodedNodeSet &Dst) { const GRState *state = GetState(Pred); if (const VarDecl* VD = dyn_cast<VarDecl>(D)) { @@ -1599,9 +1599,9 @@ void GRExprEngine::VisitCommonDeclRefExpr(const Expr *Ex, const NamedDecl *D, } /// VisitArraySubscriptExpr - Transfer function for array accesses -void GRExprEngine::VisitLvalArraySubscriptExpr(const ArraySubscriptExpr* A, - ExplodedNode* Pred, - ExplodedNodeSet& Dst){ +void ExprEngine::VisitLvalArraySubscriptExpr(const ArraySubscriptExpr* A, + ExplodedNode* Pred, + ExplodedNodeSet& Dst){ const Expr* Base = A->getBase()->IgnoreParens(); const Expr* Idx = A->getIdx()->IgnoreParens(); @@ -1627,8 +1627,8 @@ void GRExprEngine::VisitLvalArraySubscriptExpr(const ArraySubscriptExpr* A, } /// VisitMemberExpr - Transfer function for member expressions. -void GRExprEngine::VisitMemberExpr(const MemberExpr* M, ExplodedNode* Pred, - ExplodedNodeSet& Dst) { +void ExprEngine::VisitMemberExpr(const MemberExpr* M, ExplodedNode* Pred, + ExplodedNodeSet& Dst) { Expr *baseExpr = M->getBase()->IgnoreParens(); ExplodedNodeSet dstBase; @@ -1663,7 +1663,7 @@ void GRExprEngine::VisitMemberExpr(const MemberExpr* M, ExplodedNode* Pred, /// evalBind - Handle the semantics of binding a value to a specific location. /// This method is used by evalStore and (soon) VisitDeclStmt, and others. -void GRExprEngine::evalBind(ExplodedNodeSet& Dst, const Stmt* StoreE, +void ExprEngine::evalBind(ExplodedNodeSet& Dst, const Stmt* StoreE, ExplodedNode* Pred, const GRState* state, SVal location, SVal Val, bool atDeclInit) { @@ -1701,14 +1701,14 @@ void GRExprEngine::evalBind(ExplodedNodeSet& Dst, const Stmt* StoreE, } } - // The next thing to do is check if the GRTransferFuncs object wants to + // The next thing to do is check if the TransferFuncs object wants to // update the state based on the new binding. If the GRTransferFunc object // doesn't do anything, just auto-propagate the current state. // NOTE: We use 'AssignE' for the location of the PostStore if 'AssignE' // is non-NULL. Checkers typically care about - GRStmtNodeBuilderRef BuilderRef(Dst, *Builder, *this, *I, newState, StoreE, + StmtNodeBuilderRef BuilderRef(Dst, *Builder, *this, *I, newState, StoreE, true); getTF().evalBind(BuilderRef, location, Val); @@ -1723,13 +1723,13 @@ void GRExprEngine::evalBind(ExplodedNodeSet& Dst, const Stmt* StoreE, /// @param state The current simulation state /// @param location The location to store the value /// @param Val The value to be stored -void GRExprEngine::evalStore(ExplodedNodeSet& Dst, const Expr *AssignE, +void ExprEngine::evalStore(ExplodedNodeSet& Dst, const Expr *AssignE, const Expr* LocationE, ExplodedNode* Pred, const GRState* state, SVal location, SVal Val, const void *tag) { - assert(Builder && "GRStmtNodeBuilder must be defined."); + assert(Builder && "StmtNodeBuilder must be defined."); // Evaluate the location (checks for bad dereferences). ExplodedNodeSet Tmp; @@ -1752,7 +1752,7 @@ void GRExprEngine::evalStore(ExplodedNodeSet& Dst, const Expr *AssignE, evalBind(Dst, StoreE, *NI, GetState(*NI), location, Val); } -void GRExprEngine::evalLoad(ExplodedNodeSet& Dst, const Expr *Ex, +void ExprEngine::evalLoad(ExplodedNodeSet& Dst, const Expr *Ex, ExplodedNode* Pred, const GRState* state, SVal location, const void *tag, QualType LoadTy) { @@ -1784,7 +1784,7 @@ void GRExprEngine::evalLoad(ExplodedNodeSet& Dst, const Expr *Ex, evalLoadCommon(Dst, Ex, Pred, state, location, tag, LoadTy); } -void GRExprEngine::evalLoadCommon(ExplodedNodeSet& Dst, const Expr *Ex, +void ExprEngine::evalLoadCommon(ExplodedNodeSet& Dst, const Expr *Ex, ExplodedNode* Pred, const GRState* state, SVal location, const void *tag, QualType LoadTy) { @@ -1820,7 +1820,7 @@ void GRExprEngine::evalLoadCommon(ExplodedNodeSet& Dst, const Expr *Ex, } } -void GRExprEngine::evalLocation(ExplodedNodeSet &Dst, const Stmt *S, +void ExprEngine::evalLocation(ExplodedNodeSet &Dst, const Stmt *S, ExplodedNode* Pred, const GRState* state, SVal location, const void *tag, bool isLoad) { @@ -1861,7 +1861,7 @@ void GRExprEngine::evalLocation(ExplodedNodeSet &Dst, const Stmt *S, } } -bool GRExprEngine::InlineCall(ExplodedNodeSet &Dst, const CallExpr *CE, +bool ExprEngine::InlineCall(ExplodedNodeSet &Dst, const CallExpr *CE, ExplodedNode *Pred) { const GRState *state = GetState(Pred); const Expr *Callee = CE->getCallee(); @@ -1902,7 +1902,7 @@ bool GRExprEngine::InlineCall(ExplodedNodeSet &Dst, const CallExpr *CE, return false; } -void GRExprEngine::VisitCall(const CallExpr* CE, ExplodedNode* Pred, +void ExprEngine::VisitCall(const CallExpr* CE, ExplodedNode* Pred, CallExpr::const_arg_iterator AI, CallExpr::const_arg_iterator AE, ExplodedNodeSet& Dst) { @@ -1964,7 +1964,7 @@ void GRExprEngine::VisitCall(const CallExpr* CE, ExplodedNode* Pred, // Dispatch to transfer function logic to handle the call itself. // FIXME: Allow us to chain together transfer functions. - assert(Builder && "GRStmtNodeBuilder must be defined."); + assert(Builder && "StmtNodeBuilder must be defined."); getTF().evalCall(DstTmp3, *this, *Builder, CE, L, Pred); // Handle the case where no nodes where generated. Auto-generate that @@ -1988,7 +1988,7 @@ void GRExprEngine::VisitCall(const CallExpr* CE, ExplodedNode* Pred, static std::pair<const void*,const void*> EagerlyAssumeTag = std::pair<const void*,const void*>(&EagerlyAssumeTag,static_cast<void*>(0)); -void GRExprEngine::evalEagerlyAssume(ExplodedNodeSet &Dst, ExplodedNodeSet &Src, +void ExprEngine::evalEagerlyAssume(ExplodedNodeSet &Dst, ExplodedNodeSet &Src, const Expr *Ex) { for (ExplodedNodeSet::iterator I=Src.begin(), E=Src.end(); I!=E; ++I) { ExplodedNode *Pred = *I; @@ -2032,7 +2032,7 @@ void GRExprEngine::evalEagerlyAssume(ExplodedNodeSet &Dst, ExplodedNodeSet &Src, // Transfer function: Objective-C @synchronized. //===----------------------------------------------------------------------===// -void GRExprEngine::VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S, +void ExprEngine::VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst) { @@ -2049,9 +2049,9 @@ void GRExprEngine::VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S, // Transfer function: Objective-C ivar references. //===----------------------------------------------------------------------===// -void GRExprEngine::VisitLvalObjCIvarRefExpr(const ObjCIvarRefExpr* Ex, - ExplodedNode* Pred, - ExplodedNodeSet& Dst) { +void ExprEngine::VisitLvalObjCIvarRefExpr(const ObjCIvarRefExpr* Ex, + ExplodedNode* Pred, + ExplodedNodeSet& Dst) { // Visit the base expression, which is needed for computing the lvalue // of the ivar. @@ -2074,7 +2074,7 @@ void GRExprEngine::VisitLvalObjCIvarRefExpr(const ObjCIvarRefExpr* Ex, // Transfer function: Objective-C fast enumeration 'for' statements. //===----------------------------------------------------------------------===// -void GRExprEngine::VisitObjCForCollectionStmt(const ObjCForCollectionStmt* S, +void ExprEngine::VisitObjCForCollectionStmt(const ObjCForCollectionStmt* S, ExplodedNode* Pred, ExplodedNodeSet& Dst) { // ObjCForCollectionStmts are processed in two places. This method @@ -2121,7 +2121,7 @@ void GRExprEngine::VisitObjCForCollectionStmt(const ObjCForCollectionStmt* S, } } -void GRExprEngine::VisitObjCForCollectionStmtAux(const ObjCForCollectionStmt* S, +void ExprEngine::VisitObjCForCollectionStmtAux(const ObjCForCollectionStmt* S, ExplodedNode* Pred, ExplodedNodeSet& Dst, SVal ElementV) { @@ -2183,7 +2183,7 @@ public: }; } // end anonymous namespace -void GRExprEngine::VisitObjCMessageExpr(const ObjCMessageExpr* ME, +void ExprEngine::VisitObjCMessageExpr(const ObjCMessageExpr* ME, ExplodedNode* Pred, ExplodedNodeSet& Dst){ @@ -2339,8 +2339,8 @@ void GRExprEngine::VisitObjCMessageExpr(const ObjCMessageExpr* ME, // Transfer functions: Miscellaneous statements. //===----------------------------------------------------------------------===// -void GRExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex, - ExplodedNode *Pred, ExplodedNodeSet &Dst) { +void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex, + ExplodedNode *Pred, ExplodedNodeSet &Dst) { ExplodedNodeSet S1; Visit(Ex, Pred, S1); @@ -2465,7 +2465,7 @@ void GRExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex, } } -void GRExprEngine::VisitCompoundLiteralExpr(const CompoundLiteralExpr* CL, +void ExprEngine::VisitCompoundLiteralExpr(const CompoundLiteralExpr* CL, ExplodedNode* Pred, ExplodedNodeSet& Dst) { const InitListExpr* ILE @@ -2487,7 +2487,7 @@ void GRExprEngine::VisitCompoundLiteralExpr(const CompoundLiteralExpr* CL, } } -void GRExprEngine::VisitDeclStmt(const DeclStmt *DS, ExplodedNode *Pred, +void ExprEngine::VisitDeclStmt(const DeclStmt *DS, ExplodedNode *Pred, ExplodedNodeSet& Dst) { // The CFG has one DeclStmt per Decl. @@ -2556,7 +2556,7 @@ void GRExprEngine::VisitDeclStmt(const DeclStmt *DS, ExplodedNode *Pred, } } -void GRExprEngine::VisitCondInit(const VarDecl *VD, const Stmt *S, +void ExprEngine::VisitCondInit(const VarDecl *VD, const Stmt *S, ExplodedNode *Pred, ExplodedNodeSet& Dst) { const Expr* InitEx = VD->getInit(); @@ -2599,7 +2599,7 @@ public: } -void GRExprEngine::VisitInitListExpr(const InitListExpr* E, ExplodedNode* Pred, +void ExprEngine::VisitInitListExpr(const InitListExpr* E, ExplodedNode* Pred, ExplodedNodeSet& Dst) { const GRState* state = GetState(Pred); @@ -2677,7 +2677,7 @@ void GRExprEngine::VisitInitListExpr(const InitListExpr* E, ExplodedNode* Pred, } /// VisitSizeOfAlignOfExpr - Transfer function for sizeof(type). -void GRExprEngine::VisitSizeOfAlignOfExpr(const SizeOfAlignOfExpr* Ex, +void ExprEngine::VisitSizeOfAlignOfExpr(const SizeOfAlignOfExpr* Ex, ExplodedNode* Pred, ExplodedNodeSet& Dst) { QualType T = Ex->getTypeOfArgument(); @@ -2742,7 +2742,7 @@ void GRExprEngine::VisitSizeOfAlignOfExpr(const SizeOfAlignOfExpr* Ex, svalBuilder.makeIntVal(amt.getQuantity(), Ex->getType()))); } -void GRExprEngine::VisitOffsetOfExpr(const OffsetOfExpr* OOE, +void ExprEngine::VisitOffsetOfExpr(const OffsetOfExpr* OOE, ExplodedNode* Pred, ExplodedNodeSet& Dst) { Expr::EvalResult Res; if (OOE->Evaluate(Res, getContext()) && Res.Val.isInt()) { @@ -2758,7 +2758,7 @@ void GRExprEngine::VisitOffsetOfExpr(const OffsetOfExpr* OOE, Dst.Add(Pred); } -void GRExprEngine::VisitUnaryOperator(const UnaryOperator* U, +void ExprEngine::VisitUnaryOperator(const UnaryOperator* U, ExplodedNode* Pred, ExplodedNodeSet& Dst) { @@ -2996,12 +2996,12 @@ void GRExprEngine::VisitUnaryOperator(const UnaryOperator* U, } } -void GRExprEngine::VisitAsmStmt(const AsmStmt* A, ExplodedNode* Pred, +void ExprEngine::VisitAsmStmt(const AsmStmt* A, ExplodedNode* Pred, ExplodedNodeSet& Dst) { VisitAsmStmtHelperOutputs(A, A->begin_outputs(), A->end_outputs(), Pred, Dst); } -void GRExprEngine::VisitAsmStmtHelperOutputs(const AsmStmt* A, +void ExprEngine::VisitAsmStmtHelperOutputs(const AsmStmt* A, AsmStmt::const_outputs_iterator I, AsmStmt::const_outputs_iterator E, ExplodedNode* Pred, ExplodedNodeSet& Dst) { @@ -3018,7 +3018,7 @@ void GRExprEngine::VisitAsmStmtHelperOutputs(const AsmStmt* A, VisitAsmStmtHelperOutputs(A, I, E, *NI, Dst); } -void GRExprEngine::VisitAsmStmtHelperInputs(const AsmStmt* A, +void ExprEngine::VisitAsmStmtHelperInputs(const AsmStmt* A, AsmStmt::const_inputs_iterator I, AsmStmt::const_inputs_iterator E, ExplodedNode* Pred, @@ -3057,7 +3057,7 @@ void GRExprEngine::VisitAsmStmtHelperInputs(const AsmStmt* A, VisitAsmStmtHelperInputs(A, I, E, *NI, Dst); } -void GRExprEngine::VisitReturnStmt(const ReturnStmt *RS, ExplodedNode *Pred, +void ExprEngine::VisitReturnStmt(const ReturnStmt *RS, ExplodedNode *Pred, ExplodedNodeSet &Dst) { ExplodedNodeSet Src; if (const Expr *RetE = RS->getRetValue()) { @@ -3084,7 +3084,7 @@ void GRExprEngine::VisitReturnStmt(const ReturnStmt *RS, ExplodedNode *Pred, for (ExplodedNodeSet::iterator I = CheckedSet.begin(), E = CheckedSet.end(); I != E; ++I) { - assert(Builder && "GRStmtNodeBuilder must be defined."); + assert(Builder && "StmtNodeBuilder must be defined."); Pred = *I; unsigned size = Dst.size(); @@ -3105,7 +3105,7 @@ void GRExprEngine::VisitReturnStmt(const ReturnStmt *RS, ExplodedNode *Pred, // Transfer functions: Binary operators. //===----------------------------------------------------------------------===// -void GRExprEngine::VisitBinaryOperator(const BinaryOperator* B, +void ExprEngine::VisitBinaryOperator(const BinaryOperator* B, ExplodedNode* Pred, ExplodedNodeSet& Dst) { ExplodedNodeSet Tmp1; @@ -3252,7 +3252,7 @@ void GRExprEngine::VisitBinaryOperator(const BinaryOperator* B, // Checker registration/lookup. //===----------------------------------------------------------------------===// -Checker *GRExprEngine::lookupChecker(void *tag) const { +Checker *ExprEngine::lookupChecker(void *tag) const { CheckerMap::const_iterator I = CheckerM.find(tag); return (I == CheckerM.end()) ? NULL : Checkers[I->second].second; } @@ -3262,7 +3262,7 @@ Checker *GRExprEngine::lookupChecker(void *tag) const { //===----------------------------------------------------------------------===// #ifndef NDEBUG -static GRExprEngine* GraphPrintCheckerState; +static ExprEngine* GraphPrintCheckerState; static SourceManager* GraphPrintSourceManager; namespace llvm { @@ -3272,7 +3272,7 @@ struct DOTGraphTraits<ExplodedNode*> : DOTGraphTraits (bool isSimple=false) : DefaultDOTGraphTraits(isSimple) {} - // FIXME: Since we do not cache error nodes in GRExprEngine now, this does not + // FIXME: Since we do not cache error nodes in ExprEngine now, this does not // work. static std::string getNodeAttributes(const ExplodedNode* N, void*) { @@ -3460,7 +3460,7 @@ GetGraphNode<llvm::DenseMap<ExplodedNode*, Expr*>::iterator> } #endif -void GRExprEngine::ViewGraph(bool trim) { +void ExprEngine::ViewGraph(bool trim) { #ifndef NDEBUG if (trim) { std::vector<ExplodedNode*> Src; @@ -3487,7 +3487,7 @@ void GRExprEngine::ViewGraph(bool trim) { GraphPrintCheckerState = this; GraphPrintSourceManager = &getContext().getSourceManager(); - llvm::ViewGraph(*G.roots_begin(), "GRExprEngine"); + llvm::ViewGraph(*G.roots_begin(), "ExprEngine"); GraphPrintCheckerState = NULL; GraphPrintSourceManager = NULL; @@ -3495,7 +3495,7 @@ void GRExprEngine::ViewGraph(bool trim) { #endif } -void GRExprEngine::ViewGraph(ExplodedNode** Beg, ExplodedNode** End) { +void ExprEngine::ViewGraph(ExplodedNode** Beg, ExplodedNode** End) { #ifndef NDEBUG GraphPrintCheckerState = this; GraphPrintSourceManager = &getContext().getSourceManager(); @@ -3505,7 +3505,7 @@ void GRExprEngine::ViewGraph(ExplodedNode** Beg, ExplodedNode** End) { if (!TrimmedG.get()) llvm::errs() << "warning: Trimmed ExplodedGraph is empty.\n"; else - llvm::ViewGraph(*TrimmedG->roots_begin(), "TrimmedGRExprEngine"); + llvm::ViewGraph(*TrimmedG->roots_begin(), "TrimmedExprEngine"); GraphPrintCheckerState = NULL; GraphPrintSourceManager = NULL; diff --git a/clang/lib/GR/GRState.cpp b/clang/lib/GR/GRState.cpp index 993fa1a9cb4..3a4c15a8dbb 100644 --- a/clang/lib/GR/GRState.cpp +++ b/clang/lib/GR/GRState.cpp @@ -14,8 +14,8 @@ #include "clang/Analysis/CFG.h" #include "clang/GR/PathSensitive/GRStateTrait.h" #include "clang/GR/PathSensitive/GRState.h" -#include "clang/GR/PathSensitive/GRSubEngine.h" -#include "clang/GR/PathSensitive/GRTransferFuncs.h" +#include "clang/GR/PathSensitive/SubEngine.h" +#include "clang/GR/PathSensitive/TransferFuncs.h" #include "llvm/Support/raw_ostream.h" using namespace clang; @@ -114,7 +114,7 @@ const GRState *GRState::InvalidateRegions(const MemRegion * const *Begin, StoreManager::InvalidatedSymbols *IS, bool invalidateGlobals) const { GRStateManager &Mgr = getStateManager(); - GRSubEngine &Eng = Mgr.getOwningEngine(); + SubEngine &Eng = Mgr.getOwningEngine(); if (Eng.WantsRegionChangeUpdate(this)) { StoreManager::InvalidatedRegions Regions; diff --git a/clang/lib/GR/RangeConstraintManager.cpp b/clang/lib/GR/RangeConstraintManager.cpp index 378cb6e30f0..8f8528dbde6 100644 --- a/clang/lib/GR/RangeConstraintManager.cpp +++ b/clang/lib/GR/RangeConstraintManager.cpp @@ -15,7 +15,7 @@ #include "SimpleConstraintManager.h" #include "clang/GR/PathSensitive/GRState.h" #include "clang/GR/PathSensitive/GRStateTrait.h" -#include "clang/GR/PathSensitive/GRTransferFuncs.h" +#include "clang/GR/PathSensitive/TransferFuncs.h" #include "clang/GR/ManagerRegistry.h" #include "llvm/Support/Debug.h" #include "llvm/ADT/FoldingSet.h" @@ -208,7 +208,7 @@ namespace { class RangeConstraintManager : public SimpleConstraintManager{ RangeSet GetRange(const GRState *state, SymbolRef sym); public: - RangeConstraintManager(GRSubEngine &subengine) + RangeConstraintManager(SubEngine &subengine) : SimpleConstraintManager(subengine) {} const GRState *assumeSymNE(const GRState* state, SymbolRef sym, @@ -255,7 +255,7 @@ private: } // end anonymous namespace ConstraintManager* GR::CreateRangeConstraintManager(GRStateManager&, - GRSubEngine &subeng) { + SubEngine &subeng) { return new RangeConstraintManager(subeng); } diff --git a/clang/lib/GR/RegionStore.cpp b/clang/lib/GR/RegionStore.cpp index f2c47377d96..2fa8a9754a5 100644 --- a/clang/lib/GR/RegionStore.cpp +++ b/clang/lib/GR/RegionStore.cpp @@ -221,7 +221,7 @@ public: /// type. 'Array' represents the lvalue of the array being decayed /// to a pointer, and the returned SVal represents the decayed /// version of that lvalue (i.e., a pointer to the first element of - /// the array). This is called by GRExprEngine when evaluating + /// the array). This is called by ExprEngine when evaluating /// casts from arrays to pointers. SVal ArrayToPointer(Loc Array); @@ -787,7 +787,7 @@ DefinedOrUnknownSVal RegionStoreManager::getSizeInElements(const GRState *state, /// type. 'Array' represents the lvalue of the array being decayed /// to a pointer, and the returned SVal represents the decayed /// version of that lvalue (i.e., a pointer to the first element of -/// the array). This is called by GRExprEngine when evaluating casts +/// the array). This is called by ExprEngine when evaluating casts /// from arrays to pointers. SVal RegionStoreManager::ArrayToPointer(Loc Array) { if (!isa<loc::MemRegionVal>(Array)) diff --git a/clang/lib/GR/SimpleConstraintManager.cpp b/clang/lib/GR/SimpleConstraintManager.cpp index 991d0e87e4f..83e79558784 100644 --- a/clang/lib/GR/SimpleConstraintManager.cpp +++ b/clang/lib/GR/SimpleConstraintManager.cpp @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #include "SimpleConstraintManager.h" -#include "clang/GR/PathSensitive/GRExprEngine.h" +#include "clang/GR/PathSensitive/ExprEngine.h" #include "clang/GR/PathSensitive/GRState.h" #include "clang/GR/PathSensitive/Checker.h" diff --git a/clang/lib/GR/SimpleConstraintManager.h b/clang/lib/GR/SimpleConstraintManager.h index 442f0ca9f7c..616369395a1 100644 --- a/clang/lib/GR/SimpleConstraintManager.h +++ b/clang/lib/GR/SimpleConstraintManager.h @@ -22,9 +22,9 @@ namespace clang { namespace GR { class SimpleConstraintManager : public ConstraintManager { - GRSubEngine &SU; + SubEngine &SU; public: - SimpleConstraintManager(GRSubEngine &subengine) : SU(subengine) {} + SimpleConstraintManager(SubEngine &subengine) : SU(subengine) {} virtual ~SimpleConstraintManager(); //===------------------------------------------------------------------===// diff --git a/clang/lib/GR/SimpleSValBuilder.cpp b/clang/lib/GR/SimpleSValBuilder.cpp index 03f8e3076ce..2fc2347608c 100644 --- a/clang/lib/GR/SimpleSValBuilder.cpp +++ b/clang/lib/GR/SimpleSValBuilder.cpp @@ -358,7 +358,7 @@ SVal SimpleSValBuilder::evalBinOpNN(const GRState *state, case BO_XorAssign: case BO_OrAssign: case BO_Comma: - assert(false && "'=' and ',' operators handled by GRExprEngine."); + assert(false && "'=' and ',' operators handled by ExprEngine."); return UnknownVal(); case BO_PtrMemD: case BO_PtrMemI: diff --git a/clang/lib/GR/SymbolManager.cpp b/clang/lib/GR/SymbolManager.cpp index 95df3077ca5..6d078f41be6 100644 --- a/clang/lib/GR/SymbolManager.cpp +++ b/clang/lib/GR/SymbolManager.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // This file defines SymbolManager, a class that manages symbolic values -// created for use by GRExprEngine and related classes. +// created for use by ExprEngine and related classes. // //===----------------------------------------------------------------------===// |