-
Notifications
You must be signed in to change notification settings - Fork 769
SYCL: Implement some dependencies for SYCL 2020 Spec constant design #3499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The Spec-constant design (intel#3331) has a few dependencies on the CFE, including generating unique names for reachable specialization_id variables and putting the results in the integration footer. This patch helps with this effort in 2 ways: First, it creates a command line option that will be used eventually to ensure that types with internal linkage have names unique to this translation unit. This will eventually be used by the unique-id/unique-stable-name implementation, but is required as a CC1 option to unblock the Driver implementation. Second, it generates the integration footer sans the generated names (which will be added when we have the unique-id/unique-stable-name implementation in place). This is necessary to unblock library implementation of this feature.
clang/lib/Sema/SemaSYCL.cpp
Outdated
std::array<DeclContextDesc, 3> Scopes = { | ||
Util::DeclContextDesc{clang::Decl::Kind::Namespace, "cl"}, | ||
Util::DeclContextDesc{clang::Decl::Kind::Namespace, "sycl"}, | ||
Util::DeclContextDesc{Decl::Kind::ClassTemplateSpecialization, Name}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 minor questions here:
does this not need the clang:: namespace prefix?
can we not use the "specialization_id" literal here directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess none of these need 'clang::'. I just copy/pasted from above :) Same as the using specialization_id here directly. I actually don't have a good reason for it being separate. I'll do some cleanup in THIS patch for this function, then do the rest in the other patch (#3504) for the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So hold off on merging this, i want #3504 to go first. THEN I need to merge with that and do a touch of refactoring of this part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, #3504 is in now, and has been merged with this. The changes you requested here have been done.
This patch should be ready for review (and presumably approval :) )?
Ping @AaronBallman or @premanandrao . This should be ready for review now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The Spec-constant design (#3331) has a
few dependencies on the CFE, including generating unique names for
reachable specialization_id variables and putting the results in the
integration footer.
This patch helps with this effort in 2 ways:
First, it creates a command line option that will be used eventually to
ensure that types with internal linkage have names unique to this
translation unit. This will eventually be used by the
unique-id/unique-stable-name implementation, but is required as a CC1
option to unblock the Driver implementation.
Second, it generates the integration footer sans the generated names
(which will be added when we have the unique-id/unique-stable-name
implementation in place). This is necessary to unblock library
implementation of this feature.