[llvm-commits] [llvm-gcc-4.0] r40622 - in /llvm-gcc-4.0/trunk/gcc: llvm-backend.cpp llvm-convert.cpp llvm-internal.h llvm-types.cpp

Christopher Lamb christopher.lamb at gmail.com
Tue Jul 31 10:49:46 PDT 2007


On Jul 31, 2007, at 10:36 AM, Anton Korobeynikov wrote:

> Hello, Christopher.
>
>> What specifically is dangerous about this?
> Well, because you're accessing internals of tree_node structure
> directly. Please use macroses.

It may be language specific to C++, but there doesn't appear to be a  
macro there...

>> I'm no GCC expert, but the DECL_ARGUMENTS() seems to be the only  
>> place
>> where the restrict qualifier is preserved under C++. While  
>> debugging I
>> could inspect the data structure to see that the information I needed
>> was there, but looking in tree.h I found no TREE_... macro that  
>> got me
>> there.
> This sometimes mean, that such data shouldn't be used at all ;)
> What's wrong with TREE_TYPE(decl) ?

See PR1582. Using TREE_TYPE(decl) as was the case before, the tree  
doesn't contain restrict qualifiers on C++ arguments (but it does on  
C) arguments. The qualifiers are there in the DECL_ARGUMENTS(decl),  
but not in the TREE_TYPE(decl).

>> The ?: came about because while bootstrapping GCC there were cases
>> when DelArgs was NULL. It seems a bit of a hack, I know, but it's the
>> best I could figure and it seems to work properly in my tests. If you
>> have a suggestion on a more proper way to consistently get the
>> restrict qualifier I'm all ears. =)
> What was the function decl in that case?

How can I find/dump that? My GCC fu is weak.

--
Christopher Lamb



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070731/fd63532f/attachment.html>


More information about the llvm-commits mailing list