r206434 - Further simplify r206430.

Adrian Prantl aprantl at apple.com
Wed Apr 16 18:04:01 PDT 2014


Author: adrian
Date: Wed Apr 16 20:04:01 2014
New Revision: 206434

URL: http://llvm.org/viewvc/llvm-project?rev=206434&view=rev
Log:
Further simplify r206430.

rdar://problem/16636569.

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=206434&r1=206433&r2=206434&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Apr 16 20:04:01 2014
@@ -1356,19 +1356,10 @@ CollectFunctionTemplateParams(const Func
 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);
 }





More information about the cfe-commits mailing list