From: Daniel Dunbar Date: Wed, 19 Aug 2009 20:32:38 +0000 (+0000) Subject: Remove now unnecessary helper methods. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44ba7bf54434be88bda7a752f857d42cc92b462d;p=clang Remove now unnecessary helper methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79460 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Rewrite/Rewriter.h b/include/clang/Rewrite/Rewriter.h index 36d1939def..818a682200 100644 --- a/include/clang/Rewrite/Rewriter.h +++ b/include/clang/Rewrite/Rewriter.h @@ -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); diff --git a/lib/Frontend/FixItRewriter.cpp b/lib/Frontend/FixItRewriter.cpp index 5fdc2305cf..399ad1c2cd 100644 --- a/lib/Frontend/FixItRewriter.cpp +++ b/lib/Frontend/FixItRewriter.cpp @@ -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; } diff --git a/lib/Frontend/HTMLDiagnostics.cpp b/lib/Frontend/HTMLDiagnostics.cpp index 9b86755538..d92e0d4353 100644 --- a/lib/Frontend/HTMLDiagnostics.cpp +++ b/lib/Frontend/HTMLDiagnostics.cpp @@ -270,7 +270,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) { os << "\n\n" "

Annotated Source Code

\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\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 = "" + EscapedCode + ""; - R.InsertStrBefore(Hint->InsertionLoc, EscapedCode); + R.InsertTextBefore(Hint->InsertionLoc, EscapedCode); } } #endif diff --git a/lib/Rewrite/HTMLRewrite.cpp b/lib/Rewrite/HTMLRewrite.cpp index a17dde8254..925fa55312 100644 --- a/lib/Rewrite/HTMLRewrite.cpp +++ b/lib/Rewrite/HTMLRewrite.cpp @@ -339,10 +339,10 @@ void html::AddHeaderFooterInternalBuiltinCSS(Rewriter& R, FileID FID, "\n\n"; // Generate header - R.InsertStrBefore(StartLoc, os.str()); + R.InsertTextBefore(StartLoc, os.str()); // Generate footer - R.InsertCStrAfter(EndLoc, "\n"); + R.InsertTextAfter(EndLoc, "\n"); } /// SyntaxHighlight - Relex the specified FileID and annotate the HTML with