/// 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.
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)
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;
}
/// 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;