diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-04-12 15:22:25 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-04-12 15:22:25 +0000 |
commit | 3bbffd549c76dfeb3c8d7c73860736a6523cde92 (patch) | |
tree | ffca9456b4471ac2b5322615d5cc2f45bb8b82d8 /lib/Sema | |
parent | 67d080dafa74c7d126da522fec333a6e52a5ae35 (diff) |
Sema: Give a typically small DenseMap some inline capacity.
Also reflow code a bit, no change in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179382 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index f755b8ca45..7ef04e964d 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -2701,11 +2701,10 @@ void LocalInstantiationScope::InstantiatedLocal(const Decl *D, Decl *Inst) { llvm::PointerUnion<Decl *, DeclArgumentPack *> &Stored = LocalDecls[D]; if (Stored.isNull()) Stored = Inst; - else if (Stored.is<Decl *>()) { + else if (DeclArgumentPack *Pack = Stored.dyn_cast<DeclArgumentPack *>()) + Pack->push_back(Inst); + else assert(Stored.get<Decl *>() == Inst && "Already instantiated this local"); - Stored = Inst; - } else - LocalDecls[D].get<DeclArgumentPack *>()->push_back(Inst); } void LocalInstantiationScope::InstantiatedLocalPackArg(const Decl *D, |