[cfe-dev] codegening constants

Chris Lattner clattner at apple.com
Wed Aug 27 21:10:37 PDT 2008


On Aug 14, 2008, at 11:28 AM, Nuno Lopes wrote:
>>> Also, I didn't see any method in ASTContext that is appropriate  
>>> to  what I needed. getAsArrayType() in ASTContext are (in my   
>>> understanding) to make new types, not to cast a Type* into an   
>>> xxArrayType*.
>>
>> getAsArrayType can return a different type than passed in.    
>> Specifically, if you ask for the array type of a "const array of  
>> int",  you will get back an "array of const int" instead of an  
>> "array of int".
>
> From my quick testing I think I was getting 'correct' results.  
> Anyway I include a second patch in attach that uses the methods in  
> ASTContext. (I dunno why I missed those on the first time..).
> What do you think about this second version?

This patch looks great to me.  Eli, is this sufficient to handle the  
cases you know of?

-Chris



More information about the cfe-dev mailing list