]> granicus.if.org Git - clang/commitdiff
Further simplify r206430.
authorAdrian Prantl <aprantl@apple.com>
Thu, 17 Apr 2014 01:04:01 +0000 (01:04 +0000)
committerAdrian Prantl <aprantl@apple.com>
Thu, 17 Apr 2014 01:04:01 +0000 (01:04 +0000)
rdar://problem/16636569.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206434 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index dc49e1865ed765ef7a84ad28a92af047bd6c680e..132c841890290982dc4e7696023f7fb4ec05b38d 100644 (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);
 }