[cfe-commits] r158793 - in /cfe/trunk: include/clang/Basic/ include/clang/Driver/ include/clang/Frontend/ include/clang/Serialization/ lib/AST/ lib/Basic/ lib/CodeGen/ lib/Driver/ lib/Frontend/ lib/Lex/ lib/Rewrite/ lib/Sema/ lib/Serialization/ test/Analysis/ test/CodeGenObjC/ test/CodeGenObjCXX/ test/Coverage/ test/Driver/ test/Parser/ test/Preprocessor/ test/Rewriter/ test/SemaObjC/ test/SemaObjCXX/
Jordan Rose
jordan_rose at apple.com
Wed Jun 20 09:01:13 PDT 2012
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?
More information about the cfe-commits
mailing list