diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-07-29 21:43:22 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-07-29 21:43:22 +0000 |
commit | f7a0cf426eddae76e1a71dd2295631a2cf0560af (patch) | |
tree | da740e164bd7a40f49e72712c45867909f4962a1 /include/clang | |
parent | b7b6c4c6c72f817df4485329221b4de721a62340 (diff) |
Remove 'StoreManager::OldCastRegion()', TypedViewRegion (which only
OldCastRegion used), and the associated command line option
'-analyzer-store=old-basic-cast'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Analysis/PathSensitive/MemRegion.h | 63 | ||||
-rw-r--r-- | include/clang/Analysis/PathSensitive/Store.h | 15 | ||||
-rw-r--r-- | include/clang/Frontend/Analyses.def | 1 |
3 files changed, 5 insertions, 74 deletions
diff --git a/include/clang/Analysis/PathSensitive/MemRegion.h b/include/clang/Analysis/PathSensitive/MemRegion.h index a65c71b5ec..3cfcc5cd5d 100644 --- a/include/clang/Analysis/PathSensitive/MemRegion.h +++ b/include/clang/Analysis/PathSensitive/MemRegion.h @@ -46,7 +46,6 @@ public: CodeTextRegionKind, CompoundLiteralRegionKind, StringRegionKind, ElementRegionKind, - TypedViewRegionKind, // Decl Regions. BEG_DECL_REGIONS, VarRegionKind, FieldRegionKind, @@ -340,46 +339,6 @@ public: } }; -class TypedViewRegion : public TypedRegion { - friend class MemRegionManager; - QualType LValueType; - - TypedViewRegion(QualType lvalueType, const MemRegion* sreg) - : TypedRegion(sreg, TypedViewRegionKind), LValueType(lvalueType) {} - - static void ProfileRegion(llvm::FoldingSetNodeID& ID, QualType T, - const MemRegion* superRegion); - -public: - - void dumpToStream(llvm::raw_ostream& os) const; - - QualType getLocationType(ASTContext&) const { - return LValueType; - } - - QualType getValueType(ASTContext&) const { - const PointerType* PTy = LValueType->getAsPointerType(); - assert(PTy); - return PTy->getPointeeType(); - } - - bool isBoundable() const { - return isa<PointerType>(LValueType); - } - - void Profile(llvm::FoldingSetNodeID& ID) const { - ProfileRegion(ID, LValueType, superRegion); - } - - static bool classof(const MemRegion* R) { - return R->getKind() == TypedViewRegionKind; - } - - const MemRegion *removeViews() const; -}; - - /// CompoundLiteralRegion - A memory region representing a compound literal. /// Compound literals are essentially temporaries that are stack allocated /// or in the global constant pool. @@ -575,22 +534,10 @@ public: template<typename RegionTy> const RegionTy* MemRegion::getAs() const { - const MemRegion *R = this; - - do { - if (const RegionTy* RT = dyn_cast<RegionTy>(R)) - return RT; - - if (const TypedViewRegion *TR = dyn_cast<TypedViewRegion>(R)) { - R = TR->getSuperRegion(); - continue; - } - - break; - } - while (R); + if (const RegionTy* RT = dyn_cast<RegionTy>(this)) + return RT; - return 0; + return NULL; } //===----------------------------------------------------------------------===// @@ -680,10 +627,6 @@ public: /// object). ObjCIvarRegion* getObjCIvarRegion(const ObjCIvarDecl* ivd, const MemRegion* superRegion); - - TypedViewRegion* getTypedViewRegion(QualType LValueType, - const MemRegion* superRegion); - CodeTextRegion* getCodeTextRegion(SymbolRef sym, QualType t); CodeTextRegion* getCodeTextRegion(const FunctionDecl* fd, QualType t); diff --git a/include/clang/Analysis/PathSensitive/Store.h b/include/clang/Analysis/PathSensitive/Store.h index c0409d06a1..c897b374a1 100644 --- a/include/clang/Analysis/PathSensitive/Store.h +++ b/include/clang/Analysis/PathSensitive/Store.h @@ -37,12 +37,11 @@ class StoreManager { protected: ValueManager &ValMgr; GRStateManager &StateMgr; - const bool UseNewCastRegion; /// MRMgr - Manages region objects associated with this StoreManager. MemRegionManager &MRMgr; - StoreManager(GRStateManager &stateMgr, bool useNewCastRegion = false); + StoreManager(GRStateManager &stateMgr); protected: virtual const GRState *AddRegionView(const GRState *state, @@ -135,10 +134,7 @@ public: /// a MemRegion* to a specific location type. 'R' is the region being /// casted and 'CastToTy' the result type of the cast. CastResult CastRegion(const GRState *state, const MemRegion *region, - QualType CastToTy) { - return UseNewCastRegion ? NewCastRegion(state, region, CastToTy) - : OldCastRegion(state, region, CastToTy); - } + QualType CastToTy); virtual const GRState *setCastType(const GRState *state, const MemRegion* R, QualType T) { @@ -203,12 +199,6 @@ public: private: CastResult MakeElementRegion(const GRState *state, const MemRegion *region, QualType pointeeTy, QualType castToTy); - - CastResult NewCastRegion(const GRState *state, const MemRegion *region, - QualType CastToTy); - - CastResult OldCastRegion(const GRState *state, const MemRegion *region, - QualType CastToTy); }; // FIXME: Do we still need this? @@ -229,7 +219,6 @@ public: // FIXME: Do we need to pass GRStateManager anymore? StoreManager *CreateBasicStoreManager(GRStateManager& StMgr); -StoreManager *CreateBasicStoreOldCastManager(GRStateManager& StMgr); StoreManager *CreateRegionStoreManager(GRStateManager& StMgr); StoreManager *CreateFieldsOnlyRegionStoreManager(GRStateManager& StMgr); diff --git a/include/clang/Frontend/Analyses.def b/include/clang/Frontend/Analyses.def index 8974998b89..173ed135fc 100644 --- a/include/clang/Frontend/Analyses.def +++ b/include/clang/Frontend/Analyses.def @@ -53,7 +53,6 @@ ANALYSIS(CheckerCFRef, "checker-cfref", #endif ANALYSIS_STORE(BasicStore, "basic", "Use basic analyzer store", CreateBasicStoreManager) -ANALYSIS_STORE(BasicStoreOldCast, "basic-old-cast", "Use basic analyzer store with the old CastRegion", CreateBasicStoreOldCastManager) ANALYSIS_STORE(RegionStore, "region", "Use region-based analyzer store", CreateRegionStoreManager) #ifndef ANALYSIS_CONSTRAINTS |