johannes updated this revision to Diff 121656.
johannes added a comment.
update
https://reviews.llvm.org/D37005
Files:
include/clang/Tooling/ASTDiff/ASTDiff.h
include/clang/Tooling/ASTDiff/ASTPatch.h
lib/Tooling/ASTDiff/ASTDiff.cpp
lib/Tooling/ASTDiff/ASTPatch.cpp
johannes added inline comments.
Comment at: include/clang/Tooling/ASTDiff/ASTDiff.h:73
public:
+ /// Empty (invalid) SyntaxTree.
+ SyntaxTree();
arphaman wrote:
> Why do you need to create an empty tree? What about using llvm::Optional
> instead?
ok, i use
johannes updated this revision to Diff 113078.
johannes added a comment.
fixes
https://reviews.llvm.org/D37005
Files:
include/clang/Tooling/ASTDiff/ASTDiff.h
include/clang/Tooling/ASTDiff/ASTPatch.h
lib/Tooling/ASTDiff/ASTDiff.cpp
lib/Tooling/ASTDiff/ASTPatch.cpp
arphaman added inline comments.
Comment at: include/clang/Tooling/ASTDiff/ASTDiff.h:73
public:
+ /// Empty (invalid) SyntaxTree.
+ SyntaxTree();
Why do you need to create an empty tree? What about using llvm::Optional
instead?
Comment at:
arphaman added inline comments.
Comment at: include/clang/Tooling/ASTDiff/ASTPatch.h:1
+//===- ASTDiff.h - Structural patching based on ASTDiff ---*- C++ -*-
-===//
+//
Please update the file name in the comment
Comment at:
johannes updated this revision to Diff 112926.
johannes edited the summary of this revision.
johannes added a comment.
split to ASTDiff/ASTPatch
https://reviews.llvm.org/D37005
Files:
include/clang/Tooling/ASTDiff/ASTDiff.h
include/clang/Tooling/ASTDiff/ASTPatch.h
arphaman added inline comments.
Comment at: lib/Tooling/ASTDiff/ASTDiff.cpp:658
+ SourceRange Range;
+ if (auto *Arg = N.ASTNode.get())
+Range = TemplateArgumentLocations.at( - [0]);
You can drop the `auto *Arg` since Arg is unused.
johannes updated this revision to Diff 112845.
johannes retitled this revision from "Add
include/clang/Tooling/ASTDiff/ASTPatch.h" to "[clang-diff] Initial
implementation of patching".
johannes edited the summary of this revision.
johannes added a comment.
use rewriter to patch a third AST