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.

> -           .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?
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to