summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2016-08-15 16:32:18 +0000
committerHans Wennborg <hans@hanshq.net>2016-08-15 16:32:18 +0000
commit18a55edb0878d9bcb38a90c4ae4ade3f63d8f998 (patch)
tree3a522d09c2b4a45f9cf5c1e2167f3e90d86a94e8
parente3fc22ad99cda4035e2a65b99a48f91b88ff3429 (diff)
Merging r277783 and r278156 to unbreak Clang on the branch after r278674
------------------------------------------------------------------------ r277783 | timshen | 2016-08-04 16:03:44 -0700 (Thu, 04 Aug 2016) | 9 lines [ADT] Migrate DepthFirstIterator to use NodeRef Summary: The corresponding LLVM change is D23146. Reviewers: dblaikie, chandlerc Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23147 ------------------------------------------------------------------------ ------------------------------------------------------------------------ r278156 | timshen | 2016-08-09 13:22:55 -0700 (Tue, 09 Aug 2016) | 16 lines [ADT] Change iterator_adaptor_base's default template arguments to forward more underlying typedefs Summary: The corresponding LLVM change: D23217. LazyVector::iterator breaks, because int isn't an iterator type. Since iterator_adaptor_base shouldn't be blamed to break at the call to iterator_traits<int>::xxx, I'd rather "fix" LazyVector::iterator. The perfect solution is to model "relative pointer", but it's beyond the goal of this patch. Reviewers: chandlerc, bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23218 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_39@278678 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/ExternalASTSource.h5
-rw-r--r--include/clang/AST/StmtGraphTraits.h2
-rw-r--r--include/clang/Analysis/Analyses/Dominators.h1
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h2
4 files changed, 8 insertions, 2 deletions
diff --git a/include/clang/AST/ExternalASTSource.h b/include/clang/AST/ExternalASTSource.h
index 81cf631c7a..2e99f395f4 100644
--- a/include/clang/AST/ExternalASTSource.h
+++ b/include/clang/AST/ExternalASTSource.h
@@ -503,8 +503,9 @@ public:
/// We define this as a wrapping iterator around an int. The
/// iterator_adaptor_base class forwards the iterator methods to basic integer
/// arithmetic.
- class iterator : public llvm::iterator_adaptor_base<
- iterator, int, std::random_access_iterator_tag, T, int> {
+ class iterator
+ : public llvm::iterator_adaptor_base<
+ iterator, int, std::random_access_iterator_tag, T, int, T *, T &> {
LazyVector *Self;
iterator(LazyVector *Self, int Position)
diff --git a/include/clang/AST/StmtGraphTraits.h b/include/clang/AST/StmtGraphTraits.h
index ab636a5ddc..dac4495c6a 100644
--- a/include/clang/AST/StmtGraphTraits.h
+++ b/include/clang/AST/StmtGraphTraits.h
@@ -26,6 +26,7 @@ namespace llvm {
template <> struct GraphTraits<clang::Stmt*> {
typedef clang::Stmt NodeType;
+ typedef clang::Stmt * NodeRef;
typedef clang::Stmt::child_iterator ChildIteratorType;
typedef llvm::df_iterator<clang::Stmt*> nodes_iterator;
@@ -53,6 +54,7 @@ template <> struct GraphTraits<clang::Stmt*> {
template <> struct GraphTraits<const clang::Stmt*> {
typedef const clang::Stmt NodeType;
+ typedef const clang::Stmt * NodeRef;
typedef clang::Stmt::const_child_iterator ChildIteratorType;
typedef llvm::df_iterator<const clang::Stmt*> nodes_iterator;
diff --git a/include/clang/Analysis/Analyses/Dominators.h b/include/clang/Analysis/Analyses/Dominators.h
index 4524aebe4e..c64a3ca255 100644
--- a/include/clang/Analysis/Analyses/Dominators.h
+++ b/include/clang/Analysis/Analyses/Dominators.h
@@ -168,6 +168,7 @@ private:
namespace llvm {
template <> struct GraphTraits< ::clang::DomTreeNode* > {
typedef ::clang::DomTreeNode NodeType;
+ typedef ::clang::DomTreeNode *NodeRef;
typedef NodeType::iterator ChildIteratorType;
static NodeType *getEntryNode(NodeType *N) {
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h b/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
index bacb42dd17..549db1a6a1 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
@@ -452,6 +452,7 @@ public:
namespace llvm {
template<> struct GraphTraits<clang::ento::ExplodedNode*> {
typedef clang::ento::ExplodedNode NodeType;
+ typedef clang::ento::ExplodedNode *NodeRef;
typedef NodeType::succ_iterator ChildIteratorType;
typedef llvm::df_iterator<NodeType*> nodes_iterator;
@@ -478,6 +479,7 @@ namespace llvm {
template<> struct GraphTraits<const clang::ento::ExplodedNode*> {
typedef const clang::ento::ExplodedNode NodeType;
+ typedef const clang::ento::ExplodedNode *NodeRef;
typedef NodeType::const_succ_iterator ChildIteratorType;
typedef llvm::df_iterator<NodeType*> nodes_iterator;