diff options
Diffstat (limited to 'clang-tools-extra/cpp11-migrate/LoopConvert/LoopActions.cpp')
-rw-r--r-- | clang-tools-extra/cpp11-migrate/LoopConvert/LoopActions.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/clang-tools-extra/cpp11-migrate/LoopConvert/LoopActions.cpp b/clang-tools-extra/cpp11-migrate/LoopConvert/LoopActions.cpp index 0ba49d8ad4f..da9d7b56557 100644 --- a/clang-tools-extra/cpp11-migrate/LoopConvert/LoopActions.cpp +++ b/clang-tools-extra/cpp11-migrate/LoopConvert/LoopActions.cpp @@ -815,9 +815,9 @@ void LoopFixer::doConversion(ASTContext *Context, // the declaration of the alias variable. This is probably a bug. ReplacementText = ";"; - Owner.addReplacementForCurrentTU(Replacement( - Context->getSourceManager(), - CharSourceRange::getTokenRange(ReplaceRange), ReplacementText)); + Replace->insert(Replacement(Context->getSourceManager(), + CharSourceRange::getTokenRange(ReplaceRange), + ReplacementText)); // No further replacements are made to the loop, since the iterator or index // was used exactly once - in the initialization of AliasVar. } else { @@ -830,9 +830,10 @@ void LoopFixer::doConversion(ASTContext *Context, I != E; ++I) { std::string ReplaceText = I->IsArrow ? VarName + "." : VarName; ReplacedVarRanges->insert(std::make_pair(TheLoop, IndexVar)); - Owner.addReplacementForCurrentTU( + Replace->insert( Replacement(Context->getSourceManager(), - CharSourceRange::getTokenRange(I->Range), ReplaceText)); + CharSourceRange::getTokenRange(I->Range), + ReplaceText)); } } @@ -861,9 +862,9 @@ void LoopFixer::doConversion(ASTContext *Context, std::string TypeString = AutoRefType.getAsString(); std::string Range = ("(" + TypeString + " " + VarName + " : " + MaybeDereference + ContainerString + ")").str(); - Owner.addReplacementForCurrentTU( - Replacement(Context->getSourceManager(), - CharSourceRange::getTokenRange(ParenRange), Range)); + Replace->insert(Replacement(Context->getSourceManager(), + CharSourceRange::getTokenRange(ParenRange), + Range)); GeneratedDecls->insert(make_pair(TheLoop, VarName)); } |