Further simplify r206430.

rdar://problem/16636569.

llvm-svn: 206434
This commit is contained in:
Adrian Prantl 2014-04-17 01:04:01 +00:00
parent 287f989dde
commit 649f030819
1 changed files with 4 additions and 13 deletions

View File

@ -1356,19 +1356,10 @@ CollectFunctionTemplateParams(const FunctionDecl *FD, llvm::DIFile Unit) {
llvm::DIArray CGDebugInfo::
CollectCXXTemplateParams(const ClassTemplateSpecializationDecl *TSpecial,
llvm::DIFile Unit) {
llvm::PointerUnion<ClassTemplateDecl *,
ClassTemplatePartialSpecializationDecl *>
PU = TSpecial->getSpecializedTemplateOrPartial();
TemplateParameterList *TPList;
if (auto *CTD = PU.dyn_cast<ClassTemplateDecl *>())
TPList = CTD->getTemplateParameters();
else {
// Always get the full list of parameters, not just the ones from
// the specialization.
auto *CTPSD = PU.get<ClassTemplatePartialSpecializationDecl *>();
TPList = CTPSD->getSpecializedTemplate()->getTemplateParameters();
}
// Always get the full list of parameters, not just the ones from
// the specialization.
TemplateParameterList *TPList =
TSpecial->getSpecializedTemplate()->getTemplateParameters();
const TemplateArgumentList &TAList = TSpecial->getTemplateArgs();
return CollectTemplateParams(TPList, TAList.asArray(), Unit);
}