@@ -2092,17 +2092,7 @@ class SyclKernelFieldChecker : public SyclKernelFieldHandler {
20922092 }
20932093
20942094 bool handleSyclSpecialType (ParmVarDecl *PD, QualType ParamTy) final {
2095- <<<<<<< HEAD
20962095 IsInvalid |= checkSyclSpecialType (ParamTy, PD->getLocation ());
2097- =======
2098- if (!SemaSYCL::isSyclType (ParamTy, SYCLTypeAttr::work_group_memory) &&
2099- !SemaSYCL::isSyclType (ParamTy,
2100- SYCLTypeAttr::dynamic_work_group_memory)) {
2101- Diag.Report (PD->getLocation (), diag::err_bad_kernel_param_type)
2102- << ParamTy;
2103- IsInvalid = true ;
2104- }
2105- >>>>>>> 8113cb9ccb03a97ae7f7c01cd107d549ebcbb322
21062096 return isValid ();
21072097 }
21082098
@@ -2253,14 +2243,7 @@ class SyclKernelUnionChecker : public SyclKernelFieldHandler {
22532243 }
22542244
22552245 bool handleSyclSpecialType (ParmVarDecl *PD, QualType ParamTy) final {
2256- <<<<<<< HEAD
22572246 return checkType (PD->getLocation (), ParamTy);
2258- =======
2259- if (!SemaSYCL::isSyclType (ParamTy, SYCLTypeAttr::work_group_memory) &&
2260- !SemaSYCL::isSyclType (ParamTy, SYCLTypeAttr::dynamic_work_group_memory))
2261- unsupportedFreeFunctionParamType (); // TODO
2262- return true ;
2263- >>>>>>> 8113cb9ccb03a97ae7f7c01cd107d549ebcbb322
22642247 }
22652248
22662249 bool handleSyclSpecialType (const CXXRecordDecl *, const CXXBaseSpecifier &BS,
@@ -3044,7 +3027,6 @@ class SyclKernelDeclCreator : public SyclKernelFieldHandler {
30443027 }
30453028
30463029 bool handleSyclSpecialType (ParmVarDecl *PD, QualType ParamTy) final {
3047- <<<<<<< HEAD
30483030 const auto *RecordDecl = ParamTy->getAsCXXRecordDecl ();
30493031 assert (RecordDecl && " The type must be a RecordDecl" );
30503032 CXXMethodDecl *InitMethod = getMethodByName (RecordDecl, InitMethodName);
@@ -3061,29 +3043,6 @@ class SyclKernelDeclCreator : public SyclKernelFieldHandler {
30613043 Params.back ()->addAttr (AddIRAttr->clone (SemaSYCLRef.getASTContext ()));
30623044 }
30633045 LastParamIndex = ParamIndex;
3064- =======
3065- if (SemaSYCL::isSyclType (ParamTy, SYCLTypeAttr::work_group_memory) ||
3066- SemaSYCL::isSyclType (ParamTy,
3067- SYCLTypeAttr::dynamic_work_group_memory)) {
3068- const auto *RecordDecl = ParamTy->getAsCXXRecordDecl ();
3069- assert (RecordDecl && " The type must be a RecordDecl" );
3070- CXXMethodDecl *InitMethod = getMethodByName (RecordDecl, InitMethodName);
3071- assert (InitMethod && " The type must have the __init method" );
3072- // Don't do -1 here because we count on this to be the first parameter
3073- // added (if any).
3074- size_t ParamIndex = Params.size ();
3075- for (const ParmVarDecl *Param : InitMethod->parameters ()) {
3076- QualType ParamTy = Param->getType ();
3077- addParam (Param, ParamTy.getCanonicalType ());
3078- // Propagate add_ir_attributes_kernel_parameter attribute.
3079- if (const auto *AddIRAttr =
3080- Param->getAttr <SYCLAddIRAttributesKernelParameterAttr>())
3081- Params.back ()->addAttr (AddIRAttr->clone (SemaSYCLRef.getASTContext ()));
3082- }
3083- LastParamIndex = ParamIndex;
3084- } else // TODO
3085- unsupportedFreeFunctionParamType ();
3086- >>>>>>> 8113cb9ccb03a97ae7f7c01cd107d549ebcbb322
30873046 return true ;
30883047 }
30893048
@@ -4577,26 +4536,13 @@ class FreeFunctionKernelBodyCreator : public SyclKernelFieldHandler {
45774536 // TODO: Revisit this approach once https://github.com/intel/llvm/issues/16061
45784537 // is closed.
45794538 bool handleSyclSpecialType (ParmVarDecl *PD, QualType ParamTy) final {
4580- <<<<<<< HEAD
45814539 const auto *RecordDecl = ParamTy->getAsCXXRecordDecl ();
45824540 AccessSpecifier DefaultConstructorAccess;
45834541 auto DefaultConstructor =
45844542 std::find_if (RecordDecl->ctor_begin (), RecordDecl->ctor_end (),
45854543 [](auto it) { return it->isDefaultConstructor (); });
45864544 DefaultConstructorAccess = DefaultConstructor->getAccess ();
45874545 DefaultConstructor->setAccess (AS_public);
4588- =======
4589- if (SemaSYCL::isSyclType (ParamTy, SYCLTypeAttr::work_group_memory) ||
4590- SemaSYCL::isSyclType (ParamTy,
4591- SYCLTypeAttr::dynamic_work_group_memory)) {
4592- const auto *RecordDecl = ParamTy->getAsCXXRecordDecl ();
4593- AccessSpecifier DefaultConstructorAccess;
4594- auto DefaultConstructor =
4595- std::find_if (RecordDecl->ctor_begin (), RecordDecl->ctor_end (),
4596- [](auto it) { return it->isDefaultConstructor (); });
4597- DefaultConstructorAccess = DefaultConstructor->getAccess ();
4598- DefaultConstructor->setAccess (AS_public);
4599- >>>>>>> 8113cb9ccb03a97ae7f7c01cd107d549ebcbb322
46004546
46014547 QualType Ty = PD->getOriginalType ();
46024548 ASTContext &Ctx = SemaSYCLRef.SemaRef .getASTContext ();
@@ -4936,7 +4882,6 @@ class SyclKernelIntHeaderCreator : public SyclKernelFieldHandler {
49364882 addParam (PD, ParamTy, SYCLIntegrationHeader::kind_stream);
49374883 } else if (SemaSYCL::isSyclType (ParamTy, SYCLTypeAttr::work_group_memory)) {
49384884 addParam (PD, ParamTy, SYCLIntegrationHeader::kind_work_group_memory);
4939- <<<<<<< HEAD
49404885 } else if (SemaSYCL::isSyclType (ParamTy, SYCLTypeAttr::sampler) ||
49414886 SemaSYCL::isSyclType (ParamTy, SYCLTypeAttr::annotated_ptr) ||
49424887 SemaSYCL::isSyclType (ParamTy, SYCLTypeAttr::annotated_arg)) {
@@ -4951,18 +4896,15 @@ class SyclKernelIntHeaderCreator : public SyclKernelFieldHandler {
49514896 : (T->isPointerType () ? SYCLIntegrationHeader::kind_pointer
49524897 : SYCLIntegrationHeader::kind_std_layout);
49534898 addParam (PD, ParamTy, ParamKind);
4954- } else {
4899+ } else if (SemaSYCL::isSyclType (ParamTy,
4900+ SYCLTypeAttr::dynamic_work_group_memory))
4901+ addParam (PD, ParamTy,
4902+ SYCLIntegrationHeader::kind_dynamic_work_group_memory);
4903+
4904+ else {
49554905 llvm_unreachable (
49564906 " Unexpected SYCL special class when generating integration header" );
49574907 }
4958- =======
4959- else if (SemaSYCL::isSyclType (ParamTy,
4960- SYCLTypeAttr::dynamic_work_group_memory))
4961- addParam (PD, ParamTy,
4962- SYCLIntegrationHeader::kind_dynamic_work_group_memory);
4963- else
4964- unsupportedFreeFunctionParamType (); // TODO
4965- >>>>>>> 8113cb9ccb03a97ae7f7c01cd107d549ebcbb322
49664908 return true ;
49674909 }
49684910
0 commit comments