Some clean up of replacement text API no longer needed by

my recent changes.

llvm-svn: 95391
This commit is contained in:
Fariborz Jahanian 2010-02-05 16:43:40 +00:00
parent 31faefff92
commit a7e1dcdc0e
3 changed files with 5 additions and 6 deletions

View 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.

View 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;
}

View 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;