diff options
| author | Ted Kremenek <kremenek@apple.com> | 2011-05-02 19:42:42 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2011-05-02 19:42:42 +0000 |
| commit | aa181174e719405cda6b8b387ced59b856cd7b6e (patch) | |
| tree | d15ac9d8f2c0e5810f32a4514d4228924aeb2699 /clang/lib/StaticAnalyzer/Core/BasicStore.cpp | |
| parent | 24874a449c9f9fad2498165e25f9c4a640f55ab1 (diff) | |
| download | bcm5719-llvm-aa181174e719405cda6b8b387ced59b856cd7b6e.tar.gz bcm5719-llvm-aa181174e719405cda6b8b387ced59b856cd7b6e.zip | |
Augment retain/release checker to not warn about tracked objects passed as arguments to C++ constructors. This is a stop-gap measure for Objective-C++ code that uses smart pointers to manage reference counts.
llvm-svn: 130711
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/BasicStore.cpp')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/BasicStore.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BasicStore.cpp b/clang/lib/StaticAnalyzer/Core/BasicStore.cpp index 4faa84ca266..7c9f45a474c 100644 --- a/clang/lib/StaticAnalyzer/Core/BasicStore.cpp +++ b/clang/lib/StaticAnalyzer/Core/BasicStore.cpp @@ -49,11 +49,11 @@ public: SVal Retrieve(Store store, Loc loc, QualType T = QualType()); StoreRef invalidateRegion(Store store, const MemRegion *R, const Expr *E, - unsigned Count, InvalidatedSymbols *IS); + unsigned Count, InvalidatedSymbols &IS); StoreRef invalidateRegions(Store store, const MemRegion * const *Begin, const MemRegion * const *End, const Expr *E, - unsigned Count, InvalidatedSymbols *IS, + unsigned Count, InvalidatedSymbols &IS, bool invalidateGlobals, InvalidatedRegions *Regions); @@ -538,7 +538,7 @@ StoreRef BasicStoreManager::invalidateRegions(Store store, const MemRegion * const *I, const MemRegion * const *End, const Expr *E, unsigned Count, - InvalidatedSymbols *IS, + InvalidatedSymbols &IS, bool invalidateGlobals, InvalidatedRegions *Regions) { StoreRef newStore(store, *this); @@ -587,18 +587,16 @@ StoreRef BasicStoreManager::invalidateRegion(Store store, const MemRegion *R, const Expr *E, unsigned Count, - InvalidatedSymbols *IS) { + InvalidatedSymbols &IS) { R = R->StripCasts(); if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R))) return StoreRef(store, *this); - if (IS) { - BindingsTy B = GetBindings(store); - if (BindingsTy::data_type *Val = B.lookup(R)) { - if (SymbolRef Sym = Val->getAsSymbol()) - IS->insert(Sym); - } + BindingsTy B = GetBindings(store); + if (BindingsTy::data_type *Val = B.lookup(R)) { + if (SymbolRef Sym = Val->getAsSymbol()) + IS.insert(Sym); } QualType T = cast<TypedRegion>(R)->getValueType(); |

