On Jun 20, 2012, at 9:01 AM, Jordan Rose wrote:
> On Jun 19, 2012, at 11:18 PM, John McCall wrote:
>> +bool ObjCRuntime::tryParse(StringRef input) {
>> + // Look for the last dash.
>> + std::size_t dash = input.rfind('-');
>> +
>> + // We permit (1) dashes in the runtime name and (2) the version to
>> + // be omitted, so ignore dashes that aren't followed by a digit.
>> + if (dash != StringRef::npos && dash + 1 != input.size() &&
>> + (input[dash+1] < '0' || input[dash+1] > '9')) {
>> + dash = StringRef::npos;
>> + }
>> +
>
> I mis-parsed this comment as "We permit dashes in (the runtime name and the
> version) to be omitted", even with the numbers and what the code is actually
> doing.
I'll adjust this.
>> - .Case("objc_nonfragile_abi", LangOpts.ObjCNonFragileABI)
>> - .Case("objc_weak_class", LangOpts.ObjCNonFragileABI)
>> + .Case("objc_nonfragile_abi", LangOpts.ObjCRuntime.isNonFragile())
>> + .Case("objc_weak_class", LangOpts.ObjCRuntime.isNonFragile())
>> .Case("ownership_holds", true)
>> .Case("ownership_returns", true)
>> .Case("ownership_takes", true)
>> .Case("objc_bool", true)
>> - .Case("objc_subscripting", LangOpts.ObjCNonFragileABI)
>> + .Case("objc_subscripting", LangOpts.ObjCRuntime.isNonFragile())
>
> Are objc_weak_class and objc_subscripting really supposed to be defined based
> on the fragility of the runtime, and not the availability of those actual
> features?
In both cases, these features are enabled by the non-fragile runtime. Weak
import of classes does require runtime support, and subscripting syntax is not
permitted on the fragile runtime because it collides with pointer arithmetic.
I guess weak-import is arguably a NeXT-only feature; I'll make this a distinct
predicate.
John.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits