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

Ted Kremenek kremenek at apple.com
Mon Jan 12 10:23:14 PST 2009


How do we want to proceed with DeclGroups?  From my offline  
conversations my understanding is that we plan on going ahead with  
DeclGroups.

On Jan 6, 2009, at 10:09 PM, Zhongxing Xu wrote:

>
>
> On Wed, Jan 7, 2009 at 12:45 PM, Douglas Gregor <dgregor at apple.com>  
> wrote:
> On Jan 6, 2009, at 7:14 PM, Zhongxing Xu wrote:
>> On Wed, Jan 7, 2009 at 10:33 AM, Douglas Gregor <dgregor at apple.com>  
>> wrote:
>> My hunch is that what we want is to find a way to iterate through a  
>> DeclContext in a way that allows us to see the DeclGroups (or, at  
>> least, see the syntactic relationship between "struct s { }" and  
>> "s_t"). However, I'd like to hear your thoughts on these ownership  
>> and representation issues.
>>
>>        - Doug
>>
>> Hi Doug,
>>
>> I'll take a deep look at all the DeclContext stuff and mechanism in  
>> the following days. But my feeling is that DeclContext should be  
>> the ultimate solution to the ownership problem. I'll wait for your  
>> progress in this area.
>
> I'll try to get this done sooner rather than later. There is  
> documentation on DeclContexts here:
>
> 	http://clang.llvm.org/docs/InternalsManual.html#DeclContext
>
> Thanks.
>
>
>>
>> On the other hand, as you said, we still need a mechanism to  
>> recover the original syntax structure of the source (and more  
>> ideally, the layout of the source code). I think the DeclGroup  
>> could play that role with the following structure:
>>                       DeclGroup => TypeSpecifier Decls
>>
>> Instead of owning the decls, the DeclGroup and TypeSpecifier could  
>> only refer to the decls with a pointer.
>
> Yes, I agree.
>
>>
>> Also the TopLevelDecls in TranslationUnit probably could be kept to  
>> reflect the code layout?
>
> We shouldn't need it. A DeclContext's list of declarations  
> (accessible via decls_begin/decls_end) contains all of the  
> declarations in the order they occur within the source code, which  
> is the same information that TopLevelDecls tries to capture now.
>
> OK.
>
>
> 	- Doug
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090112/036a8eae/attachment.html>


More information about the cfe-dev mailing list