diff options
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index b344b0687f2..508124a2a6e 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -760,10 +760,8 @@ ASTContext::~ASTContext() { ReleaseDeclContextMaps(); // Call all of the deallocation functions on all of their targets. - for (DeallocationMap::const_iterator I = Deallocations.begin(), - E = Deallocations.end(); I != E; ++I) - for (unsigned J = 0, N = I->second.size(); J != N; ++J) - (I->first)((I->second)[J]); + for (auto &Pair : Deallocations) + (Pair.first)(Pair.second); // ASTRecordLayout objects in ASTRecordLayouts must always be destroyed // because they can contain DenseMaps. @@ -812,7 +810,7 @@ void ASTContext::ReleaseParentMapEntries() { } void ASTContext::AddDeallocation(void (*Callback)(void*), void *Data) { - Deallocations[Callback].push_back(Data); + Deallocations.push_back({Callback, Data}); } void |

