[cfe-commits] r79460 - in /cfe/trunk: include/clang/Rewrite/Rewriter.h lib/Frontend/FixItRewriter.cpp lib/Frontend/HTMLDiagnostics.cpp lib/Rewrite/HTMLRewrite.cpp

Daniel Dunbar daniel at zuster.org
Wed Aug 19 13:32:38 PDT 2009


Author: ddunbar
Date: Wed Aug 19 15:32:38 2009
New Revision: 79460

URL: http://llvm.org/viewvc/llvm-project?rev=79460&view=rev
Log:
Remove now unnecessary helper methods.

Modified:
    cfe/trunk/include/clang/Rewrite/Rewriter.h
    cfe/trunk/lib/Frontend/FixItRewriter.cpp
    cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp
    cfe/trunk/lib/Rewrite/HTMLRewrite.cpp

Modified: cfe/trunk/include/clang/Rewrite/Rewriter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Rewrite/Rewriter.h?rev=79460&r1=79459&r2=79460&view=diff

==============================================================================
--- cfe/trunk/include/clang/Rewrite/Rewriter.h (original)
+++ cfe/trunk/include/clang/Rewrite/Rewriter.h Wed Aug 19 15:32:38 2009
@@ -178,25 +178,6 @@
   bool InsertTextBefore(SourceLocation Loc, const llvm::StringRef &Str) {
     return InsertText(Loc, Str, false);
   }
-
-
-  bool InsertCStrBefore(SourceLocation Loc, const char* Str) {
-    return InsertTextBefore(Loc, Str);
-  }
-  
-  
-  bool InsertCStrAfter(SourceLocation Loc, const char* Str) {
-    return InsertTextAfter(Loc, Str);
-  }
-  
-  bool InsertStrBefore(SourceLocation Loc, const std::string& Str) {
-    return InsertTextBefore(Loc, Str);
-  }
-
-  bool InsertStrAfter(SourceLocation Loc, const std::string& Str) {
-    return InsertTextAfter(Loc, Str);
-  }
-  
   
   /// RemoveText - Remove the specified text region.
   bool RemoveText(SourceLocation Start, unsigned Length);

Modified: cfe/trunk/lib/Frontend/FixItRewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FixItRewriter.cpp?rev=79460&r1=79459&r2=79460&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/FixItRewriter.cpp (original)
+++ cfe/trunk/lib/Frontend/FixItRewriter.cpp Wed Aug 19 15:32:38 2009
@@ -159,7 +159,7 @@
     const CodeModificationHint &Hint = Info.getCodeModificationHint(Idx);
     if (!Hint.RemoveRange.isValid()) {
       // We're adding code.
-      if (Rewrite.InsertStrBefore(Hint.InsertionLoc, Hint.CodeToInsert))
+      if (Rewrite.InsertTextBefore(Hint.InsertionLoc, Hint.CodeToInsert))
         Failed = true;
       continue;
     }

Modified: cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp?rev=79460&r1=79459&r2=79460&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp (original)
+++ cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp Wed Aug 19 15:32:38 2009
@@ -270,7 +270,7 @@
     os << "</table>\n<!-- REPORTSUMMARYEXTRA -->\n"
           "<h3>Annotated Source Code</h3>\n";    
     
-    R.InsertStrBefore(SMgr.getLocForStartOfFile(FID), os.str());
+    R.InsertTextBefore(SMgr.getLocForStartOfFile(FID), os.str());
   }
   
   // Embed meta-data tags.
@@ -302,7 +302,7 @@
     os << "\n<!-- BUGMETAEND -->\n";
     
     // Insert the text.
-    R.InsertStrBefore(SMgr.getLocForStartOfFile(FID), os.str());
+    R.InsertTextBefore(SMgr.getLocForStartOfFile(FID), os.str());
   }
   
   // Add CSS, header, and footer.
@@ -511,7 +511,7 @@
   SourceLocation Loc = 
     SM.getLocForStartOfFile(LPosInfo.first).getFileLocWithOffset(DisplayPos);
 
-  R.InsertStrBefore(Loc, os.str());
+  R.InsertTextBefore(Loc, os.str());
 
   // Now highlight the ranges.  
   for (const SourceRange *I = P.ranges_begin(), *E = P.ranges_end();
@@ -534,7 +534,7 @@
       std::string EscapedCode = html::EscapeText(Hint->CodeToInsert, true);
       EscapedCode = "<span class=\"CodeInsertionHint\">" + EscapedCode
         + "</span>";
-      R.InsertStrBefore(Hint->InsertionLoc, EscapedCode);
+      R.InsertTextBefore(Hint->InsertionLoc, EscapedCode);
     }
   }
 #endif

Modified: cfe/trunk/lib/Rewrite/HTMLRewrite.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/HTMLRewrite.cpp?rev=79460&r1=79459&r2=79460&view=diff

==============================================================================
--- cfe/trunk/lib/Rewrite/HTMLRewrite.cpp (original)
+++ cfe/trunk/lib/Rewrite/HTMLRewrite.cpp Wed Aug 19 15:32:38 2009
@@ -339,10 +339,10 @@
       "</style>\n</head>\n<body>";
 
   // Generate header
-  R.InsertStrBefore(StartLoc, os.str());
+  R.InsertTextBefore(StartLoc, os.str());
   // Generate footer
   
-  R.InsertCStrAfter(EndLoc, "</body></html>\n");
+  R.InsertTextAfter(EndLoc, "</body></html>\n");
 }
 
 /// SyntaxHighlight - Relex the specified FileID and annotate the HTML with





More information about the cfe-commits mailing list