diff options
author | Justin Lebar <jlebar@google.com> | 2016-10-10 16:26:08 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-10-10 16:26:08 +0000 |
commit | 28f09c50e2f0712c39438b4363361ada90726b39 (patch) | |
tree | fde595734ed6bc062985a8c1ceab037cbe8e1a98 /clang/lib/Serialization/ASTReader.cpp | |
parent | 11091971567af8a1609a81082eb8cfafaa5d4bda (diff) | |
download | bcm5719-llvm-28f09c50e2f0712c39438b4363361ada90726b39.tar.gz bcm5719-llvm-28f09c50e2f0712c39438b4363361ada90726b39.zip |
[Sema] Use unique_ptr instead of raw pointers in the late-parsed templates map.
Summary:
This is possible now that MapVector supports move-only values.
Depends on D25404.
Reviewers: timshen
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25405
llvm-svn: 283766
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index d12dda66dbf..52e06e482e1 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -7556,12 +7556,13 @@ void ASTReader::ReadPendingInstantiations( } void ASTReader::ReadLateParsedTemplates( - llvm::MapVector<const FunctionDecl *, LateParsedTemplate *> &LPTMap) { + llvm::MapVector<const FunctionDecl *, std::unique_ptr<LateParsedTemplate>> + &LPTMap) { for (unsigned Idx = 0, N = LateParsedTemplates.size(); Idx < N; /* In loop */) { FunctionDecl *FD = cast<FunctionDecl>(GetDecl(LateParsedTemplates[Idx++])); - LateParsedTemplate *LT = new LateParsedTemplate; + auto LT = llvm::make_unique<LateParsedTemplate>(); LT->D = GetDecl(LateParsedTemplates[Idx++]); ModuleFile *F = getOwningModuleFile(LT->D); @@ -7572,7 +7573,7 @@ void ASTReader::ReadLateParsedTemplates( for (unsigned T = 0; T < TokN; ++T) LT->Toks.push_back(ReadToken(*F, LateParsedTemplates, Idx)); - LPTMap.insert(std::make_pair(FD, LT)); + LPTMap.insert(std::make_pair(FD, std::move(LT))); } LateParsedTemplates.clear(); |