[cfe-commits] r164861 - in /cfe/trunk: bindings/xml/comment-xml-schema.rng tools/libclang/CXComment.cpp

Jordan Rose jordan_rose at apple.com
Mon Oct 1 09:33:50 PDT 2012


On Sep 30, 2012, at 20:41 , Douglas Gregor <dgregor at apple.com> 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).



More information about the cfe-commits mailing list