diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-01-28 01:41:20 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-01-28 01:41:20 +0000 |
commit | 7e20ffe322866f6a2e820e054da9bd0f6e9b0af4 (patch) | |
tree | 173f75690abae9bd5484c729cf6ee7902e841a79 /lib/Rewrite/Rewriter.cpp | |
parent | ce7024e8a3793b05861a4904ecdb1272924ada14 (diff) |
Fixes a rewrite bug rewriting nested ivars reference.
(Radar 7583971).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94724 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/Rewriter.cpp')
-rw-r--r-- | lib/Rewrite/Rewriter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Rewrite/Rewriter.cpp b/lib/Rewrite/Rewriter.cpp index 9744496ac4..96a2a06a44 100644 --- a/lib/Rewrite/Rewriter.cpp +++ b/lib/Rewrite/Rewriter.cpp @@ -207,9 +207,10 @@ 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) { +bool Rewriter::ReplaceStmt(Stmt *From, Stmt *To, int Size) { // Measaure the old text. - int Size = getRangeSize(From->getSourceRange()); + if (!Size) + Size = getRangeSize(From->getSourceRange()); if (Size == -1) return true; |