This is an archive of the discontinued LLVM Phabricator instance.

[CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).
ClosedPublic

Authored by jlebar on Sep 30 2016, 9:33 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

jlebar updated this revision to Diff 73071.Sep 30 2016, 9:33 AM
jlebar retitled this revision from to [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...)..
jlebar updated this object.
jlebar added a reviewer: rnk.
jlebar added subscribers: tra, cfe-commits.
rnk added inline comments.Sep 30 2016, 9:44 AM
clang/lib/Parse/ParseExprCXX.cpp
1135 ↗(On Diff #73071)

Does nvcc support __declspec style attributes? Maybe we should check for those too?

1280 ↗(On Diff #73071)

Let's not duplicate this amazingly long type info thingy. I think you can avoid it if you hoist MutableLoc and add a bool like NeedFuncDeclaratorChunk. Also, maybe we shouldn't be hallucinating a function declarator chunk in CUDA when there are no attributes?

jlebar updated this revision to Diff 73085.Sep 30 2016, 10:19 AM
jlebar marked an inline comment as done.

Don't hallucinate a function declarator.

clang/lib/Parse/ParseExprCXX.cpp
1135 ↗(On Diff #73071)

nvcc doesn't seem to support __declspec attributes.

I have no strong opinion on whether or not we should add them ourselves, though I guess I have a weak aversion to mucking with the parsing rules more than is necessary. (I put off this patch for as long as I could while I tried to get nvcc to put the attributes in the right place.)

1280 ↗(On Diff #73071)

Oh, I didn't look closely enough at the API to realize that I could add attributes without creating a new function declarator chunk. New patch is a much smaller change.

rnk accepted this revision.Sep 30 2016, 10:22 AM
rnk edited edge metadata.

lgtm

clang/lib/Parse/ParseExprCXX.cpp
1135 ↗(On Diff #73071)

Nope, let's leave declspec alone then. :)

This revision is now accepted and ready to land.Sep 30 2016, 10:22 AM
This revision was automatically updated to reflect the committed changes.