[cfe-dev] attributes on function arguments

Nick Lewycky nlewycky at google.com
Sat May 30 22:43:34 PDT 2009


Now with added patch!

2009/5/30 Nick Lewycky <nlewycky at google.com>

> I tried to implement a novel attribute, "__attribute__((nocapture))" which
> would apply LLVM's "nocapture" attribute to pointer-typed parameters or
> arguments in a function declaration or call. There don't seem to be any
> attributes like this to copy the technique.
>
> The attribute goes onto the ParamVarDecl just fine but those don't seem to
> line up with the CGFunctionInfo's args due to things like implicit "this"
> and such. Also, it doesn't seem like ArgInfo is a good place to put an
> attribute like nocapture.
>
> Does anyone have a suggestion for how this should work in Clang? I've
> attached my attempt at an implementation.
>
> Thanks,
> Nick
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090530/52b23605/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nocapture.patch
Type: text/x-diff
Size: 6834 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090530/52b23605/attachment.patch>


More information about the cfe-dev mailing list