[cfe-dev] [PATCH] Extend the use of DeclGroup

Zhongxing Xu xuzhongxing at gmail.com
Sun Jan 4 01:10:48 PST 2009


This patch is the first step to solve the problem that no one is owning the
struct decl in the following code:

typedef struct s {} s_t;

Later a TypeSpecifier holding this struct decl will be added to DeclGroup as
discussed on the mailing list months before.

The root of changes is at Sema::FinalizeDeclaratorGroup.  It returns
DeclGroupOwningRef instead of DeclTy*.  A bunch of related methods now
return
DeclGroupOwningRef instead of DeclTy*.

Top level declarations are DeclGroups instead of Decls.  TranslationUnit
uses a vector of DeclGroupOwningRef to track all Decls.  Most of the dtor of
TranslationUnit is disabled. The cleanup works should be done by the
DeclGroup.

LinkageSpecDecl now uses a DeclGroup array to track all Decls.

Three ObjC static analysis test cases fail. I haven't figured out the
reasons.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090104/f3e6b0ec/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dg.patch
Type: application/octet-stream
Size: 42563 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090104/f3e6b0ec/attachment.obj>


More information about the cfe-dev mailing list