@@ -1313,9 +1313,8 @@ llvm::DIType *CGDebugInfo::CreateType(const BlockPointerType *Ty,
1313
1313
return DBuilder.createPointerType (EltTy, Size);
1314
1314
}
1315
1315
1316
- CGDebugInfo::TemplateArgs
1317
- CGDebugInfo::GetTemplateArgs (const TemplateDecl *TD,
1318
- const TemplateSpecializationType *Ty) const {
1316
+ static llvm::SmallVector<TemplateArgument>
1317
+ GetTemplateArgs (const TemplateDecl *TD, const TemplateSpecializationType *Ty) {
1319
1318
assert (Ty->isTypeAlias ());
1320
1319
// TemplateSpecializationType doesn't know if its template args are
1321
1320
// being substituted into a parameter pack. We can find out if that's
@@ -1366,7 +1365,7 @@ CGDebugInfo::GetTemplateArgs(const TemplateDecl *TD,
1366
1365
break ;
1367
1366
}
1368
1367
}
1369
- return {TD-> getTemplateParameters (), SpecArgs} ;
1368
+ return SpecArgs;
1370
1369
}
1371
1370
1372
1371
llvm::DIType *CGDebugInfo::CreateType (const TemplateSpecializationType *Ty,
@@ -1391,7 +1390,8 @@ llvm::DIType *CGDebugInfo::CreateType(const TemplateSpecializationType *Ty,
1391
1390
SourceLocation Loc = AliasDecl->getLocation ();
1392
1391
1393
1392
if (CGM.getCodeGenOpts ().DebugTemplateAlias ) {
1394
- TemplateArgs Args = GetTemplateArgs (TD, Ty);
1393
+ auto ArgVector = ::GetTemplateArgs (TD, Ty);
1394
+ TemplateArgs Args = {TD->getTemplateParameters (), ArgVector};
1395
1395
1396
1396
// FIXME: Respect DebugTemplateNameKind::Mangled, e.g. by using GetName.
1397
1397
// Note we can't use GetName without additional work: TypeAliasTemplateDecl
0 commit comments