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, 8 insertions, 9 deletions
diff --git a/clang-tools-extra/cpp11-migrate/LoopConvert/LoopActions.cpp b/clang-tools-extra/cpp11-migrate/LoopConvert/LoopActions.cpp index da9d7b56557..0ba49d8ad4f 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 = ";"; - Replace->insert(Replacement(Context->getSourceManager(), - CharSourceRange::getTokenRange(ReplaceRange), - ReplacementText)); + Owner.addReplacementForCurrentTU(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,10 +830,9 @@ void LoopFixer::doConversion(ASTContext *Context, I != E; ++I) { std::string ReplaceText = I->IsArrow ? VarName + "." : VarName; ReplacedVarRanges->insert(std::make_pair(TheLoop, IndexVar)); - Replace->insert( + Owner.addReplacementForCurrentTU( Replacement(Context->getSourceManager(), - CharSourceRange::getTokenRange(I->Range), - ReplaceText)); + CharSourceRange::getTokenRange(I->Range), ReplaceText)); } } @@ -862,9 +861,9 @@ void LoopFixer::doConversion(ASTContext *Context, std::string TypeString = AutoRefType.getAsString(); std::string Range = ("(" + TypeString + " " + VarName + " : " + MaybeDereference + ContainerString + ")").str(); - Replace->insert(Replacement(Context->getSourceManager(), - CharSourceRange::getTokenRange(ParenRange), - Range)); + Owner.addReplacementForCurrentTU( + Replacement(Context->getSourceManager(), + CharSourceRange::getTokenRange(ParenRange), Range)); GeneratedDecls->insert(make_pair(TheLoop, VarName)); } |