[PATCH] D137251: [clang][cuda/hip] Allow `__noinline__` lambdas

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 3 10:23:17 PDT 2022


yaxunl added inline comments.


================
Comment at: clang/lib/Parse/ParseExprCXX.cpp:1300
+        ParseGNUAttributes(Attr, nullptr, &D);
+      } else if (Tok.is(tok::kw___noinline__)) {
+        IdentifierInfo *AttrName = Tok.getIdentifierInfo();
----------------
Pierre-vh wrote:
> aaron.ballman wrote:
> > Any other keyword attributes that are missing?
> > 
> > `alignas`/`_Alignas`
> > `__forceinline`
> > `__cdecl`/`__stdcall`/etc
> > 
> I'm not too familiar with how those attributes work yet, so maybe there's more to handle but I don't have any concrete example of it being an issue and would rather not touch those unless needed
CUDA only allows `__attribute__` for lambda. `__noinline__` used to be an attribute. That's why people use it with lambda. I don't think people use other keywords with lambda.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137251/new/

https://reviews.llvm.org/D137251



More information about the cfe-commits mailing list