On Oct 1, 2012, at 9:36 , Douglas Gregor <[email protected]> wrote:

> 
> On Oct 1, 2012, at 9:33 AM, Jordan Rose <[email protected]> wrote:
> 
>> 
>> On Sep 30, 2012, at 20:41 , Douglas Gregor <[email protected]> wrote:
>> 
>>>> +      Result << "<Availability";
>>>> +      StringRef distribution;
>>>> +      if (AA->getPlatform()) {
>>>> +        distribution = AA->getPlatform()->getName();
>>>> +        if (distribution == "macosx")
>>>> +          distribution = "OSX";
>>>> +        else
>>>> +          distribution = "iOS";
>>>> +      }
>>> 
>>> I agree with Dmitri, and suggest here that you map macosx -> OS X, ios -> 
>>> iOS, and pass through the other names. Isn't there already code to do this 
>>> in the AST library? Can it be abstracted nicely?
>> 
>> I think what makes it tricky (read: hardcoded) is that these have to be XML 
>> node names, i.e. no spaces and few special characters. It's too bad they 
>> can't be attributes, though:
>> 
>> <Availability platform="ios">...</Availability>
>> 
>> ...but we're going for compatibility with an existing format (if internal).
> 
> Huh?
> 
> The existing format is
> 
>  <Availability distribution="iOS">…</Availability>
> 
> or
> 
>  <Availability distribution="OS X">…</Availability>
> 
> The "ios" and "macosx" names are baked into the 'availability' attribute. 
> Those we can't change, but that's fine; they're meant to be identifiers.

Oh, whoops! I read this wrong. In that case, yes, I think there should either 
be an assert or explicit handling (or no distribution at all) if the platform 
isn't OS X or iOS. Also, if "OS X" really does have a space, the code is wrong.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to