[cfe-commits] r95391 - in /cfe/trunk: include/clang/Rewrite/Rewriter.h lib/Frontend/RewriteObjC.cpp lib/Rewrite/Rewriter.cpp
Fariborz Jahanian
fjahanian at apple.com
Fri Feb 5 08:43:40 PST 2010
Author: fjahanian
Date: Fri Feb 5 10:43:40 2010
New Revision: 95391
URL: http://llvm.org/viewvc/llvm-project?rev=95391&view=rev
Log:
Some clean up of replacement text API no longer needed by
my recent changes.
Modified:
cfe/trunk/include/clang/Rewrite/Rewriter.h
cfe/trunk/lib/Frontend/RewriteObjC.cpp
cfe/trunk/lib/Rewrite/Rewriter.cpp
Modified: cfe/trunk/include/clang/Rewrite/Rewriter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Rewrite/Rewriter.h?rev=95391&r1=95390&r2=95391&view=diff
==============================================================================
--- cfe/trunk/include/clang/Rewrite/Rewriter.h (original)
+++ cfe/trunk/include/clang/Rewrite/Rewriter.h Fri Feb 5 10:43:40 2010
@@ -190,7 +190,7 @@
/// 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.
Modified: cfe/trunk/lib/Frontend/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/RewriteObjC.cpp?rev=95391&r1=95390&r2=95391&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteObjC.cpp Fri Feb 5 10:43:40 2010
@@ -167,7 +167,7 @@
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 @@
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;
}
Modified: cfe/trunk/lib/Rewrite/Rewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/Rewriter.cpp?rev=95391&r1=95390&r2=95391&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/Rewriter.cpp (original)
+++ cfe/trunk/lib/Rewrite/Rewriter.cpp Fri Feb 5 10:43:40 2010
@@ -207,10 +207,9 @@
/// 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;
More information about the cfe-commits
mailing list