Skip to content

Conversation

@steffenlarsen
Copy link
Contributor

This commit fixes a number of known issues when the integration header generates prototypes of the free-function kernels. These changes focus on the additional removal of aliasing and proper handling of templated template arguments.

This commit also adds disabled test cases for a known issue with unresolved nested templated type aliases. These are cases for future work.

This commit fixes a number of known issues when the integration header
generates prototypes of the free-function kernels. These changes focus
on the additional removal of aliasing and proper handling of templated
template arguments.

This commit also adds disabled test cases for a known issue with
unresolved nested templated type aliases. These are cases for future
work.

Signed-off-by: Larsen, Steffen <[email protected]>
Co-authored-by: Sachkov, Alexey <[email protected]>
Copy link
Contributor

@Fznamznon Fznamznon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just questions, will continue with meaningful review on Monday.
@elizabethandrews , @premanandrao given the size of the pr you're weclome to review as well.

}

const TemplateSpecializationType *
getAsTemplateSpecializationTypeWithoutAliases(const ASTContext &Ctx) const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to have it as a member of Type class rather than a static function in SemaSYCL.cpp?

const TemplateSpecializationType *TST =
getAsNonAliasTemplateSpecializationType();
if (!TST)
return TST;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks a bit unusual, can we make it explicit?

Suggested change
return TST;
return nullptr;

return TST;
}

const TemplateSpecializationType *
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also have a documentation comment explaining what the function does and what is the difference from getAsNonAliasTemplateSpecializationType ?


const TemplateSpecializationType *TSTAsNonAlias =
TST->getAsNonAliasTemplateSpecializationType();
TST->getAsTemplateSpecializationTypeWithoutAliases(Context);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I was kind of expecting that the visitor soluiton would help us to avoid unwrapping and modifying types manually like getAsTemplateSpecializationTypeWithoutAliases does. Is that not the case? Could you please elaborate why do we need such a complex solution?

/// What this visitor does is it iterates over both in sync, picking the right
/// values from one or another.
///
/// Moral of the story: drop integration header ASAP (but that is blocked
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol, now we have two comments in SemaSYCL saying drop integration header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants