This revision was automatically updated to reflect the committed changes.
Closed by commit rL334542: [analyzer] [NFC] Remove 
"removeInvalidation" from visitor API (authored by george.karpenkov, 
committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D48045?vs=150809&id=151020#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D48045

Files:
  cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
  cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp


Index: cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
===================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
@@ -253,13 +253,6 @@
   void markInvalid(const void *Tag, const void *Data) {
     Invalidations.insert(std::make_pair(Tag, Data));
   }
-
-  /// Reverses the effects of a previous invalidation.
-  ///
-  /// \sa markInvalid
-  void removeInvalidation(const void *Tag, const void *Data) {
-    Invalidations.erase(std::make_pair(Tag, Data));
-  }
   
   /// Return the canonical declaration, be it a method or class, where
   /// this issue semantically occurred.
Index: cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
===================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
@@ -616,6 +616,7 @@
   } Mode = Initial;
 
   bool EnableNullFPSuppression;
+  bool ShouldInvalidate = true;
 
 public:
   ReturnVisitor(const StackFrameContext *Frame, bool Suppressed)
@@ -845,7 +846,7 @@
 
       if (bugreporter::trackNullOrUndefValue(N, ArgE, BR, /*IsArg=*/true,
                                              EnableNullFPSuppression))
-        BR.removeInvalidation(ReturnVisitor::getTag(), StackFrame);
+        ShouldInvalidate = false;
 
       // If we /can't/ track the null pointer, we should err on the side of
       // false negatives, and continue towards marking this report invalid.
@@ -873,7 +874,7 @@
 
   void finalizeVisitor(BugReporterContext &BRC, const ExplodedNode *N,
                        BugReport &BR) override {
-    if (EnableNullFPSuppression)
+    if (EnableNullFPSuppression && ShouldInvalidate)
       BR.markInvalid(ReturnVisitor::getTag(), StackFrame);
   }
 };


Index: cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
===================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
@@ -253,13 +253,6 @@
   void markInvalid(const void *Tag, const void *Data) {
     Invalidations.insert(std::make_pair(Tag, Data));
   }
-
-  /// Reverses the effects of a previous invalidation.
-  ///
-  /// \sa markInvalid
-  void removeInvalidation(const void *Tag, const void *Data) {
-    Invalidations.erase(std::make_pair(Tag, Data));
-  }
   
   /// Return the canonical declaration, be it a method or class, where
   /// this issue semantically occurred.
Index: cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
===================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
@@ -616,6 +616,7 @@
   } Mode = Initial;
 
   bool EnableNullFPSuppression;
+  bool ShouldInvalidate = true;
 
 public:
   ReturnVisitor(const StackFrameContext *Frame, bool Suppressed)
@@ -845,7 +846,7 @@
 
       if (bugreporter::trackNullOrUndefValue(N, ArgE, BR, /*IsArg=*/true,
                                              EnableNullFPSuppression))
-        BR.removeInvalidation(ReturnVisitor::getTag(), StackFrame);
+        ShouldInvalidate = false;
 
       // If we /can't/ track the null pointer, we should err on the side of
       // false negatives, and continue towards marking this report invalid.
@@ -873,7 +874,7 @@
 
   void finalizeVisitor(BugReporterContext &BRC, const ExplodedNode *N,
                        BugReport &BR) override {
-    if (EnableNullFPSuppression)
+    if (EnableNullFPSuppression && ShouldInvalidate)
       BR.markInvalid(ReturnVisitor::getTag(), StackFrame);
   }
 };
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D48045: [analyzer... George Karpenkov via Phabricator via cfe-commits

Reply via email to