[cfe-dev] attributes on function arguments

Nick Lewycky nlewycky at google.com
Sat May 30 20:38:32 PDT 2009


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/8e711db0/attachment.html>


More information about the cfe-dev mailing list