[clang] [ParserHLSL] Attempt to parse HLSL annotations on Field Decls. (PR #96346)
Joshua Batista via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 21 12:52:09 PDT 2024
================
@@ -2646,6 +2646,9 @@ bool Parser::ParseCXXMemberDeclaratorBeforeInitializer(
else
DeclaratorInfo.SetIdentifier(nullptr, Tok.getLocation());
+ if (getLangOpts().HLSL)
----------------
bob80905 wrote:
I think the crucial difference between the two is that one overload is intended to parse annotations for the purpose of creating attributes to attach to a specific declarator. The other simply parses the present attributes and fills in a ParsedAttributes object. The latter is used in `ParseHLSLBuffer`, where there is no decl to attach the attributes to yet. The former is convenient since it will attach the attributes after parsing for you.
They could be combined if an extra parameter is passed, a pointer to a declarator, and then add the attributes if it's non-null, but I don't think that's really necessary.
https://github.com/llvm/llvm-project/pull/96346
More information about the cfe-commits
mailing list