From: Fariborz Jahanian Date: Fri, 5 Feb 2010 16:43:40 +0000 (+0000) Subject: Some clean up of replacement text API no longer needed by X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88906cddbb1d5b3a868eeeec6cb170befc829c2f;p=clang Some clean up of replacement text API no longer needed by my recent changes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95391 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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;