]> granicus.if.org Git - clang/commitdiff
Some clean up of replacement text API no longer needed by
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 5 Feb 2010 16:43:40 +0000 (16:43 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 5 Feb 2010 16:43:40 +0000 (16:43 +0000)
my recent changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95391 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Rewrite/Rewriter.h
lib/Frontend/RewriteObjC.cpp
lib/Rewrite/Rewriter.cpp

index e625b4a36ecbf2baa01d1233bed9d4684d276eb9..1692180a6da9a3e2ee9a159c5b6849d80eb097ad 100644 (file)
@@ -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.
index 1c4925eeaa038d03e2199afe270b7724e08a4a59..dcd83c61bf2ff83a3935b1c2fb86a66dd61266ff 100644 (file)
@@ -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;
       }
index 96a2a06a44b4df071b5e745123a676ddcb63bcdd..9744496ac4fe0b99f13ec6d19cd673bb064ac783 100644 (file)
@@ -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;