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(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 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,6 +1119,14 @@ 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(); } @@ -1127,6 +1135,7 @@ 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(); }