diff options
Diffstat (limited to 'clang/lib/Rewrite')
| -rw-r--r-- | clang/lib/Rewrite/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | clang/lib/Rewrite/Rewriter.cpp | 21 |
2 files changed, 0 insertions, 22 deletions
diff --git a/clang/lib/Rewrite/CMakeLists.txt b/clang/lib/Rewrite/CMakeLists.txt index 0c77536012a..16550b1b710 100644 --- a/clang/lib/Rewrite/CMakeLists.txt +++ b/clang/lib/Rewrite/CMakeLists.txt @@ -10,7 +10,6 @@ add_clang_library(clangRewrite TokenRewriter.cpp LINK_LIBS - clangAST clangBasic clangLex ) diff --git a/clang/lib/Rewrite/Rewriter.cpp b/clang/lib/Rewrite/Rewriter.cpp index eab4ccfeadc..c8f4c80b1e6 100644 --- a/clang/lib/Rewrite/Rewriter.cpp +++ b/clang/lib/Rewrite/Rewriter.cpp @@ -328,27 +328,6 @@ bool Rewriter::ReplaceText(SourceRange range, SourceRange replacementRange) { return ReplaceText(start, origLength, MB.substr(newOffs, newLength)); } -/// ReplaceStmt - This replaces a Stmt/Expr with another, using the pretty -/// printer to generate the replacement code. This returns true if the input -/// could not be rewritten, or false if successful. -bool Rewriter::ReplaceStmt(Stmt *From, Stmt *To) { - assert(From != nullptr && To != nullptr && "Expected non-null Stmt's"); - - // Measaure the old text. - int Size = getRangeSize(From->getSourceRange()); - if (Size == -1) - return true; - - // Get the new text. - std::string SStr; - llvm::raw_string_ostream S(SStr); - To->printPretty(S, nullptr, PrintingPolicy(*LangOpts)); - const std::string &Str = S.str(); - - ReplaceText(From->getLocStart(), Size, Str); - return false; -} - std::string Rewriter::ConvertToString(Stmt *From) { assert(From != nullptr && "Expected non-null Stmt"); std::string SStr; |

