aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/DeclBase.cpp2
-rw-r--r--lib/Basic/ObjCRuntime.cpp5
-rw-r--r--lib/Lex/PPMacroExpansion.cpp2
3 files changed, 5 insertions, 4 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index 7d72093700..574f779b86 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -430,7 +430,7 @@ bool Decl::canBeWeakImported(bool &IsDefinition) const {
// Objective-C classes, if this is the non-fragile runtime.
} else if (isa<ObjCInterfaceDecl>(this) &&
- getASTContext().getLangOpts().ObjCRuntime.isNonFragile()) {
+ getASTContext().getLangOpts().ObjCRuntime.hasWeakClassImport()) {
return true;
// Nothing else.
diff --git a/lib/Basic/ObjCRuntime.cpp b/lib/Basic/ObjCRuntime.cpp
index d92adbcb46..d66da0706f 100644
--- a/lib/Basic/ObjCRuntime.cpp
+++ b/lib/Basic/ObjCRuntime.cpp
@@ -43,8 +43,9 @@ 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.
+ // We permit dashes in the runtime name, and we also permit the
+ // version to be omitted, so if we see a dash not followed by a
+ // digit then we need to ignore it.
if (dash != StringRef::npos && dash + 1 != input.size() &&
(input[dash+1] < '0' || input[dash+1] > '9')) {
dash = StringRef::npos;
diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp
index 826fa03621..a5337867b1 100644
--- a/lib/Lex/PPMacroExpansion.cpp
+++ b/lib/Lex/PPMacroExpansion.cpp
@@ -644,7 +644,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
.Case("objc_instancetype", LangOpts.ObjC2)
.Case("objc_modules", LangOpts.ObjC2 && LangOpts.Modules)
.Case("objc_nonfragile_abi", LangOpts.ObjCRuntime.isNonFragile())
- .Case("objc_weak_class", LangOpts.ObjCRuntime.isNonFragile())
+ .Case("objc_weak_class", LangOpts.ObjCRuntime.hasWeakClassImport())
.Case("ownership_holds", true)
.Case("ownership_returns", true)
.Case("ownership_takes", true)