r312677 - [StaticAnalyzer] Fix failures due to the iteration order of ExplodedNode

Mandeep Singh Grang via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 6 15:54:59 PDT 2017


Author: mgrang
Date: Wed Sep  6 15:54:59 2017
New Revision: 312677

URL: http://llvm.org/viewvc/llvm-project?rev=312677&view=rev
Log:
[StaticAnalyzer] Fix failures due to the iteration order of ExplodedNode

Summary:
This fixes failures seen in the reverse iteration builder:
http://lab.llvm.org:8011/builders/reverse-iteration/builds/26

Failing Tests (4):
    Clang :: Analysis/MisusedMovedObject.cpp
    Clang :: Analysis/keychainAPI.m
    Clang :: Analysis/loop-unrolling.cpp
    Clang :: Analysis/malloc.c

Reviewers: zaks.anna, bkramer, chandlerc, krememek, nikhgupt

Reviewed By: zaks.anna

Subscribers: dcoughlin, NoQ, cfe-commits

Differential Revision: https://reviews.llvm.org/D37400

Modified:
    cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h

Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h?rev=312677&r1=312676&r2=312677&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h Wed Sep  6 15:54:59 2017
@@ -27,7 +27,7 @@
 #include "llvm/ADT/DepthFirstIterator.h"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/ADT/SetVector.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/Casting.h"
 #include <memory>
@@ -404,7 +404,7 @@ private:
 };
 
 class ExplodedNodeSet {
-  typedef llvm::SmallPtrSet<ExplodedNode*,5> ImplTy;
+  typedef llvm::SmallSetVector<ExplodedNode*, 4> ImplTy;
   ImplTy Impl;
 
 public:
@@ -424,7 +424,7 @@ public:
 
   unsigned size() const { return Impl.size();  }
   bool empty()    const { return Impl.empty(); }
-  bool erase(ExplodedNode *N) { return Impl.erase(N); }
+  bool erase(ExplodedNode *N) { return Impl.remove(N); }
 
   void clear() { Impl.clear(); }
   void insert(const ExplodedNodeSet &S) {




More information about the cfe-commits mailing list