[cfe-dev] codegening constants

Eli Friedman eli.friedman at gmail.com
Wed Aug 27 21:41:20 PDT 2008

On Wed, Aug 27, 2008 at 9:10 PM, Chris Lattner <clattner at apple.com> wrote:
> 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?

It looks correct to me; I can't think of any cases where this isn't
the right thing.


More information about the cfe-dev mailing list