johannes created this revision.
Herald added a subscriber: klimek.

https://reviews.llvm.org/D39653

Files:
  include/clang/Tooling/ASTDiff/ASTDiff.h
  lib/Tooling/ASTDiff/ASTDiff.cpp


Index: lib/Tooling/ASTDiff/ASTDiff.cpp
===================================================================
--- lib/Tooling/ASTDiff/ASTDiff.cpp
+++ lib/Tooling/ASTDiff/ASTDiff.cpp
@@ -1119,14 +1119,23 @@
 
 ASTUnit &SyntaxTree::getASTUnit() const { return TreeImpl->AST; }
 
+SourceManager &SyntaxTree::getSourceManager() const {
+  return TreeImpl->AST.getSourceManager();
+}
+
+const LangOptions &SyntaxTree::getLangOpts() const {
+  return TreeImpl->AST.getLangOpts();
+}
+
 const ASTContext &SyntaxTree::getASTContext() const {
   return TreeImpl->AST.getASTContext();
 }
 
 NodeRef SyntaxTree::getNode(NodeId Id) const { return TreeImpl->getNode(Id); }
 
 int SyntaxTree::getSize() const { return TreeImpl->getSize(); }
 NodeRef SyntaxTree::getRoot() const { return TreeImpl->getRoot(); }
+NodeId SyntaxTree::getRootId() const { return TreeImpl->getRootId(); }
 SyntaxTree::PreorderIterator SyntaxTree::begin() const {
   return TreeImpl->begin();
 }
Index: include/clang/Tooling/ASTDiff/ASTDiff.h
===================================================================
--- include/clang/Tooling/ASTDiff/ASTDiff.h
+++ include/clang/Tooling/ASTDiff/ASTDiff.h
@@ -80,14 +80,18 @@
   SyntaxTree(T *Node, ASTUnit &AST)
       : TreeImpl(llvm::make_unique<Impl>(this, Node, AST)) {}
   SyntaxTree(SyntaxTree &&Other) = default;
+  SyntaxTree &operator=(SyntaxTree &&Other) = default;
   ~SyntaxTree();
 
   ASTUnit &getASTUnit() const;
   const ASTContext &getASTContext() const;
+  SourceManager &getSourceManager() const;
+  const LangOptions &getLangOpts() const;
   StringRef getFilename() const;
 
   int getSize() const;
   NodeRef getRoot() const;
+  NodeId getRootId() const;
   using PreorderIterator = const Node *;
   PreorderIterator begin() const;
   PreorderIterator end() const;
@@ -113,6 +117,10 @@
   SmallVector<NodeId, 4> Children;
   ChangeKind Change = NoChange;
   Node(SyntaxTree::Impl &Tree) : Tree(Tree), Children() {}
+  Node(NodeRef Other) = delete;
+  explicit Node(Node &&Other) = default;
+  Node &operator=(NodeRef Other) = delete;
+  Node &operator=(Node &&Other) = default;
 
   NodeId getId() const;
   SyntaxTree &getTree() const;


Index: lib/Tooling/ASTDiff/ASTDiff.cpp
===================================================================
--- lib/Tooling/ASTDiff/ASTDiff.cpp
+++ lib/Tooling/ASTDiff/ASTDiff.cpp
@@ -1119,14 +1119,23 @@
 
 ASTUnit &SyntaxTree::getASTUnit() const { return TreeImpl->AST; }
 
+SourceManager &SyntaxTree::getSourceManager() const {
+  return TreeImpl->AST.getSourceManager();
+}
+
+const LangOptions &SyntaxTree::getLangOpts() const {
+  return TreeImpl->AST.getLangOpts();
+}
+
 const ASTContext &SyntaxTree::getASTContext() const {
   return TreeImpl->AST.getASTContext();
 }
 
 NodeRef SyntaxTree::getNode(NodeId Id) const { return TreeImpl->getNode(Id); }
 
 int SyntaxTree::getSize() const { return TreeImpl->getSize(); }
 NodeRef SyntaxTree::getRoot() const { return TreeImpl->getRoot(); }
+NodeId SyntaxTree::getRootId() const { return TreeImpl->getRootId(); }
 SyntaxTree::PreorderIterator SyntaxTree::begin() const {
   return TreeImpl->begin();
 }
Index: include/clang/Tooling/ASTDiff/ASTDiff.h
===================================================================
--- include/clang/Tooling/ASTDiff/ASTDiff.h
+++ include/clang/Tooling/ASTDiff/ASTDiff.h
@@ -80,14 +80,18 @@
   SyntaxTree(T *Node, ASTUnit &AST)
       : TreeImpl(llvm::make_unique<Impl>(this, Node, AST)) {}
   SyntaxTree(SyntaxTree &&Other) = default;
+  SyntaxTree &operator=(SyntaxTree &&Other) = default;
   ~SyntaxTree();
 
   ASTUnit &getASTUnit() const;
   const ASTContext &getASTContext() const;
+  SourceManager &getSourceManager() const;
+  const LangOptions &getLangOpts() const;
   StringRef getFilename() const;
 
   int getSize() const;
   NodeRef getRoot() const;
+  NodeId getRootId() const;
   using PreorderIterator = const Node *;
   PreorderIterator begin() const;
   PreorderIterator end() const;
@@ -113,6 +117,10 @@
   SmallVector<NodeId, 4> Children;
   ChangeKind Change = NoChange;
   Node(SyntaxTree::Impl &Tree) : Tree(Tree), Children() {}
+  Node(NodeRef Other) = delete;
+  explicit Node(Node &&Other) = default;
+  Node &operator=(NodeRef Other) = delete;
+  Node &operator=(Node &&Other) = default;
 
   NodeId getId() const;
   SyntaxTree &getTree() const;
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to