From: Zhongxing Xu Date: Mon, 8 Feb 2010 06:00:22 +0000 (+0000) Subject: ASTContext is now a reference member of StoreManager. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a393db0969630d01a71fd384affb33ea0a693d1;p=clang ASTContext is now a reference member of StoreManager. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95531 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Checker/PathSensitive/Store.h b/include/clang/Checker/PathSensitive/Store.h index 3121e461bc..7d93688344 100644 --- a/include/clang/Checker/PathSensitive/Store.h +++ b/include/clang/Checker/PathSensitive/Store.h @@ -41,6 +41,7 @@ protected: /// MRMgr - Manages region objects associated with this StoreManager. MemRegionManager &MRMgr; + ASTContext &Ctx; StoreManager(GRStateManager &stateMgr); diff --git a/lib/Checker/FlatStore.cpp b/lib/Checker/FlatStore.cpp index ca182708e1..fdeeab9529 100644 --- a/lib/Checker/FlatStore.cpp +++ b/lib/Checker/FlatStore.cpp @@ -179,8 +179,8 @@ void FlatStoreManager::iterBindings(Store store, BindingsHandler& f) { Interval FlatStoreManager::RegionToInterval(const MemRegion *R) { switch (R->getKind()) { case MemRegion::VarRegionKind: { - QualType T = cast(R)->getValueType(StateMgr.getContext()); - uint64_t Size = StateMgr.getContext().getTypeSize(T); + QualType T = cast(R)->getValueType(Ctx); + uint64_t Size = Ctx.getTypeSize(T); return Interval(0, Size-1); } default: diff --git a/lib/Checker/Store.cpp b/lib/Checker/Store.cpp index c7746a6dec..5893733c54 100644 --- a/lib/Checker/Store.cpp +++ b/lib/Checker/Store.cpp @@ -19,7 +19,7 @@ using namespace clang; StoreManager::StoreManager(GRStateManager &stateMgr) : ValMgr(stateMgr.getValueManager()), StateMgr(stateMgr), - MRMgr(ValMgr.getRegionManager()) {} + MRMgr(ValMgr.getRegionManager()), Ctx(stateMgr.getContext()) {} const MemRegion *StoreManager::MakeElementRegion(const MemRegion *Base, QualType EleTy, uint64_t index) {