@@ -3364,17 +3364,17 @@ class SYCLFwdDeclEmitter
3364
3364
using InnerTypeVisitor = TypeVisitor<SYCLFwdDeclEmitter>;
3365
3365
using InnerTemplArgVisitor = ConstTemplateArgumentVisitor<SYCLFwdDeclEmitter>;
3366
3366
raw_ostream &OS;
3367
- llvm::SmallPtrSetImpl <const void *> & Printed;
3367
+ llvm::SmallPtrSet <const NamedDecl *, 4 > Printed;
3368
3368
PrintingPolicy Policy;
3369
3369
3370
- void printForwardDecl (Decl *D) {
3370
+ void printForwardDecl (NamedDecl *D) {
3371
3371
// wrap the declaration into namespaces if needed
3372
3372
unsigned NamespaceCnt = 0 ;
3373
3373
std::string NSStr = " " ;
3374
3374
const DeclContext *DC = D->getDeclContext ();
3375
3375
3376
3376
while (DC) {
3377
- auto *NS = dyn_cast_or_null<NamespaceDecl>(DC);
3377
+ const auto *NS = dyn_cast_or_null<NamespaceDecl>(DC);
3378
3378
3379
3379
if (!NS)
3380
3380
break ;
@@ -3411,7 +3411,7 @@ class SYCLFwdDeclEmitter
3411
3411
}
3412
3412
3413
3413
// Checks if we've already printed forward declaration and prints it if not.
3414
- void checkAndEmitForwardDecl (Decl *D) {
3414
+ void checkAndEmitForwardDecl (NamedDecl *D) {
3415
3415
if (Printed.insert (D).second )
3416
3416
printForwardDecl (D);
3417
3417
}
@@ -3422,10 +3422,7 @@ class SYCLFwdDeclEmitter
3422
3422
}
3423
3423
3424
3424
public:
3425
- SYCLFwdDeclEmitter (raw_ostream &OS,
3426
- llvm::SmallPtrSetImpl<const void *> &Printed,
3427
- LangOptions LO)
3428
- : OS(OS), Printed(Printed), Policy(LO) {
3425
+ SYCLFwdDeclEmitter (raw_ostream &OS, LangOptions LO) : OS(OS), Policy(LO) {
3429
3426
Policy.adjustForCPlusPlusFwdDecl ();
3430
3427
Policy.SuppressTypedefs = true ;
3431
3428
Policy.SuppressUnwrittenScope = true ;
@@ -3688,8 +3685,7 @@ void SYCLIntegrationHeader::emit(raw_ostream &O) {
3688
3685
if (!UnnamedLambdaSupport) {
3689
3686
O << " // Forward declarations of templated kernel function types:\n " ;
3690
3687
3691
- llvm::SmallPtrSet<const void *, 4 > Printed;
3692
- SYCLFwdDeclEmitter FwdDeclEmitter (O, Printed, S.getLangOpts ());
3688
+ SYCLFwdDeclEmitter FwdDeclEmitter (O, S.getLangOpts ());
3693
3689
for (const KernelDesc &K : KernelDescs)
3694
3690
FwdDeclEmitter.Visit (K.NameType );
3695
3691
}
0 commit comments