diff options
-rw-r--r-- | include/clang/Rewrite/Rewriter.h | 2 | ||||
-rw-r--r-- | lib/Frontend/RewriteObjC.cpp | 4 | ||||
-rw-r--r-- | lib/Rewrite/Rewriter.cpp | 5 |
3 files changed, 5 insertions, 6 deletions
diff --git a/include/clang/Rewrite/Rewriter.h b/include/clang/Rewrite/Rewriter.h index e625b4a36e..1692180a6d 100644 --- a/include/clang/Rewrite/Rewriter.h +++ b/include/clang/Rewrite/Rewriter.h @@ -190,7 +190,7 @@ public: /// 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 ReplaceStmt(Stmt *From, Stmt *To, int Size=0); + bool ReplaceStmt(Stmt *From, Stmt *To); /// getRewriteBufferFor - Return the rewrite buffer for the specified FileID. /// If no modification has been made to it, return null. diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp index 1c4925eeaa..dcd83c61bf 100644 --- a/lib/Frontend/RewriteObjC.cpp +++ b/lib/Frontend/RewriteObjC.cpp @@ -167,7 +167,7 @@ namespace { virtual void HandleTranslationUnit(ASTContext &C); - void ReplaceStmt(Stmt *Old, Stmt *New, int Size=0) { + void ReplaceStmt(Stmt *Old, Stmt *New) { Stmt *ReplacingStmt = ReplacedNodes[Old]; if (ReplacingStmt) @@ -177,7 +177,7 @@ namespace { return; // Used when rewriting the assignment of a property setter. // If replacement succeeded or warning disabled return with no warning. - if (!Rewrite.ReplaceStmt(Old, New, Size)) { + if (!Rewrite.ReplaceStmt(Old, New)) { ReplacedNodes[Old] = New; return; } diff --git a/lib/Rewrite/Rewriter.cpp b/lib/Rewrite/Rewriter.cpp index 96a2a06a44..9744496ac4 100644 --- a/lib/Rewrite/Rewriter.cpp +++ b/lib/Rewrite/Rewriter.cpp @@ -207,10 +207,9 @@ bool Rewriter::ReplaceText(SourceLocation Start, unsigned OrigLength, /// 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, int Size) { +bool Rewriter::ReplaceStmt(Stmt *From, Stmt *To) { // Measaure the old text. - if (!Size) - Size = getRangeSize(From->getSourceRange()); + int Size = getRangeSize(From->getSourceRange()); if (Size == -1) return true; |