[cfe-commits] [PATCH] Extend lexical scope of attributes to include function parameters.

Delesley Hutchins delesley at google.com
Fri Sep 2 11:42:52 PDT 2011


This patch extends the lexical scope of attributes to include method
parameters.  The main motivation for this patch is to implement thread
safety attributes, such as the following:

class Foo {
  int foo(Foo *f) __attribute__((exclusive_locks_required(f->mu))) { }

  Mutex mu;
};

The change in scope is only enabled for attributes that are tagged as
being late parsed, using the previous late parsing patch; this
currently means that it is enabled only for thread-safety attributes.
It also works only on methods and not top-level functions, since
top-level functions do not currently use late parsing.

  http://codereview.appspot.com/4959055/

  -DeLesley

-- 
DeLesley Hutchins | Software Engineer | delesley at google.com | 505-206-0315
-------------- next part --------------
A non-text attachment was scrubbed...
Name: function_parameter_parsing2.patch
Type: text/x-patch
Size: 2855 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110902/10439bb7/attachment.bin>


More information about the cfe-commits mailing list