-
Notifications
You must be signed in to change notification settings - Fork 795
[SYCL] Let tablegen handle mutually exclusive decl attrs #3507
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3664,10 +3664,12 @@ static void GenerateMutualExclusionsChecks(const Record &Attr, | |
| if (Attr.isSubClassOf("TypeAttr")) | ||
| return; | ||
|
|
||
| // This means the attribute is either a statement attribute or a decl | ||
| // attribute, find out which. | ||
| // This means the attribute is either a statement attribute, a decl | ||
| // attribute, or both; find out which. | ||
| bool CurAttrIsStmtAttr = | ||
| Attr.isSubClassOf("StmtAttr") || Attr.isSubClassOf("DeclOrStmtAttr"); | ||
| bool CurAttrIsDeclAttr = | ||
| !CurAttrIsStmtAttr || Attr.isSubClassOf("DeclOrStmtAttr"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AaronBallman, isn't the second bool the same as: Wouldn't this match anything that is not StmtAttr?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's correct. There are three kinds of attributes (four-ish if you count pragmas, but those never get here): type, stmt, and decl. We bail out early if it's a type attribute on line 3664, so by this point it should either be a statement attr, a decl attr, or both.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do you want to handle this PR? Is there a separate PR to address statement attributes? I just don't want us to lose track of it. I will approve this one, assuming that one won't fall through the cracks.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think so. Here is the discussion:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Statement attributes need more love; I'm working on that refactoring currently. If it looks like that refactoring has to be set down for some reason, I'll file an issue about it.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @premanandrao, @AaronBallman, is this conversation resolved or I should wait for PR updates?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not expecting to change this PR further unless I've missed something or there are other concerns.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sorry, I should have been more explicit. I considered this resolved. |
||
|
|
||
| std::vector<std::string> DeclAttrs, StmtAttrs; | ||
|
|
||
|
|
@@ -3686,7 +3688,7 @@ static void GenerateMutualExclusionsChecks(const Record &Attr, | |
|
|
||
| if (CurAttrIsStmtAttr) | ||
| StmtAttrs.push_back((AttrToExclude->getName() + "Attr").str()); | ||
| else | ||
| if (CurAttrIsDeclAttr) | ||
| DeclAttrs.push_back((AttrToExclude->getName() + "Attr").str()); | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.