]> granicus.if.org Git - clang/commitdiff
Remove trivial destructor from SVal.
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 18 Jul 2012 19:08:44 +0000 (19:08 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 18 Jul 2012 19:08:44 +0000 (19:08 +0000)
This enables the faster SmallVector in clang and also allows clang's unused
variable warnings to be more effective. Fix the two instances that popped up.

The RetainCountChecker change actually changes functionality, it would be nice
if someone from the StaticAnalyzer folks could look at it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160444 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h
lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp

index ee818b356b114c3f560e1724aaa383197977ad3c..1f79f0276bb11cde6ed5283c5dde65e04a47b887 100644 (file)
@@ -68,7 +68,6 @@ protected:
 
 public:
   explicit SVal() : Data(0), Kind(0) {}
-  ~SVal() {}
 
   /// BufferTy - A temporary buffer to hold a set of SVals.
   typedef SmallVector<SVal,5> BufferTy;
index b641c71bc3071286a3f09be5284c5553ec874429..afb862cd6c9a9bcb7320010b9b14c2ae0b7a064c 100644 (file)
@@ -559,7 +559,6 @@ ProgramStateRef GenericTaintChecker::postScanf(const CallExpr *CE,
   if (CE->getNumArgs() < 2)
     return State;
 
-  SVal x = State->getSVal(CE->getArg(1), C.getLocationContext());
   // All arguments except for the very first one should get taint.
   for (unsigned int i = 1; i < CE->getNumArgs(); ++i) {
     // The arguments are pointer arguments. The data they are pointing at is
index a156f0dc458978c9b135d834f9f89a6132f0ef58..c44fc67d265bf143669ea566da6d072eddca2bcc 100644 (file)
@@ -3168,7 +3168,7 @@ bool RetainCountChecker::evalCall(const CallExpr *CE, CheckerContext &C) const {
     // If the receiver is unknown, conjure a return value.
     SValBuilder &SVB = C.getSValBuilder();
     unsigned Count = C.getCurrentBlockCount();
-    SVal RetVal = SVB.getConjuredSymbolVal(0, CE, LCtx, ResultTy, Count);
+    RetVal = SVB.getConjuredSymbolVal(0, CE, LCtx, ResultTy, Count);
   }
   state = state->BindExpr(CE, LCtx, RetVal, false);