]> granicus.if.org Git - clang/commitdiff
Remove now unnecessary helper methods.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 19 Aug 2009 20:32:38 +0000 (20:32 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 19 Aug 2009 20:32:38 +0000 (20:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79460 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Rewrite/Rewriter.h
lib/Frontend/FixItRewriter.cpp
lib/Frontend/HTMLDiagnostics.cpp
lib/Rewrite/HTMLRewrite.cpp

index 36d1939def649362beb21cb9e2aa11b68b2242cd..818a68220096d9b79c27785b4439c16bb9ca7d74 100644 (file)
@@ -178,25 +178,6 @@ public:
   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);
index 5fdc2305cfb22af11f3e5af85757c394cda2a810..399ad1c2cd7b4f17e1d6b04d26c0baa95e3a8cb5 100644 (file)
@@ -159,7 +159,7 @@ void FixItRewriter::HandleDiagnostic(Diagnostic::Level DiagLevel,
     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;
     }
index 9b86755538ff7004bba36f9962dcd6684a80245e..d92e0d43538fc14e724b010d0ef2759fcb732c66 100644 (file)
@@ -270,7 +270,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {
     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 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {
     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 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, FileID BugFileID,
   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 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, FileID BugFileID,
       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
index a17dde8254c79e88edea2e069dded2ebf7ae6c53..925fa5531283e513935eda28fbeccc7a92e394e1 100644 (file)
@@ -339,10 +339,10 @@ void html::AddHeaderFooterInternalBuiltinCSS(Rewriter& R, FileID FID,
       "</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