forked from OSchip/llvm-project
Some clean up of replacement text API no longer needed by
my recent changes. llvm-svn: 95391
This commit is contained in:
parent
31faefff92
commit
a7e1dcdc0e
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue