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
/// this template instantiation.
Sema &SemaRef;
- typedef llvm::DenseMap<const Decl *,
- llvm::PointerUnion<Decl *, DeclArgumentPack *> >
- LocalDeclsMap;
-
+ typedef llvm::SmallDenseMap<
+ const Decl *, llvm::PointerUnion<Decl *, DeclArgumentPack *>, 4>
+ LocalDeclsMap;
+
/// \brief A mapping from local declarations that occur
/// within a template to their instantiations.
///
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,