[cfe-commits] [PATCH] Delayed parsing for GNU attributes

Delesley Hutchins delesley at google.com
Thu Sep 1 13:40:37 PDT 2011


This patch implements delayed parsing for GNU attributes.  The main
motivation for this patch is to implement thread safety attributes,
such as the following:

class Foo {
  int x __attribute__((guarded_by(mu)));
  int foo() __attribute__((exclusive_locks_required(mu)));
  Mutex mu;
}

Delayed parsing is now turned on for any GNU attribute that specifies
LateParsed=1 in Attr.td.  Note that support for delayed parsing is
incomplete, in that it is only enabled for attributes at the end of a
member declaration; this is due to a limitation in the current
implementation that we hope to remove at some point.

Patches for llvm and clang are attached, and can also be found at:

  http://codereview.appspot.com/4975048/
  http://codereview.appspot.com/4975049/

Cheers,

DeLesley Hutchins and Caitlin Sadowski

-- 
DeLesley Hutchins | Software Engineer | delesley at google.com | 505-206-0315
-------------- next part --------------
A non-text attachment was scrubbed...
Name: generalized_late_attribute_tablegen.patch
Type: text/x-patch
Size: 3571 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110901/2e6bc96f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: generalized_late_attribute_full.patch
Type: text/x-patch
Size: 34713 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110901/2e6bc96f/attachment-0001.bin>


More information about the cfe-commits mailing list