[PATCH] D129883: [HLSL] Support cbuffer/tbuffer for hlsl.
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 8 11:09:09 PDT 2022
aaron.ballman added a comment.
(I didn't have the chance to do a complete review, but I did a partial one and spotted some things)
================
Comment at: clang/lib/Parse/ParseHLSL.cpp:79-80
+ ParsedAttributes Attrs(AttrFactory);
+ MaybeParseCXX11Attributes(Attrs);
+ MaybeParseMicrosoftAttributes(Attrs);
+
----------------
Just double-checking, but this allows `[[]]` style attributes as well as `[]` style attributes, but not `__attribute__` or `__declspec` style attributes, is that intended?
================
Comment at: clang/lib/Sema/SemaHLSL.cpp:31-32
+void Sema::ActOnFinishHLSLBuffer(Decl *Dcl, SourceLocation RBrace) {
+ auto *BufDecl = dyn_cast_if_present<HLSLBufferDecl>(Dcl);
+ assert(BufDecl && "Invalid parameter, expected HLSLBufferDecl");
+ BufDecl->setRBraceLoc(RBrace);
----------------
`cast` will assert if given nullptr or the cast is invalid, so this should be equivalent.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129883/new/
https://reviews.llvm.org/D129883
More information about the cfe-commits
mailing list