aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-04-07 14:18:33 +0000
committerSteve Naroff <snaroff@apple.com>2009-04-07 14:18:33 +0000
commitd9fd7647e286723d100db4cfeab31ec022eec629 (patch)
treea83feade7246bc33f845deca0cd65aad26c72d7d /lib/Sema/SemaExprObjC.cpp
parent7e075cb62c06e0b0023fd12875c95da9c5ddefb7 (diff)
Change the type of ObjC @ string constants (from NSConstantString->NSString).
This fixes <rdar://problem/6757102> clang type for @"xxx" is "NSConstantString *" (GCC type is "NSString *"). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68514 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r--lib/Sema/SemaExprObjC.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index bd94f007ba..cfa279aa31 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -69,19 +69,21 @@ Sema::ExprResult Sema::ParseObjCStringLiteral(SourceLocation *AtLocs,
return true;
// Initialize the constant string interface lazily. This assumes
- // the NSConstantString interface is seen in this translation unit.
+ // the NSString interface is seen in this translation unit. Note: We
+ // don't use NSConstantString, since the runtime team considers this
+ // interface private (even though it appears in the header files).
QualType Ty = Context.getObjCConstantStringInterface();
if (!Ty.isNull()) {
Ty = Context.getPointerType(Ty);
} else {
- IdentifierInfo *NSIdent = &Context.Idents.get("NSConstantString");
+ IdentifierInfo *NSIdent = &Context.Idents.get("NSString");
NamedDecl *IF = LookupName(TUScope, NSIdent, LookupOrdinaryName);
if (ObjCInterfaceDecl *StrIF = dyn_cast_or_null<ObjCInterfaceDecl>(IF)) {
Context.setObjCConstantStringInterface(StrIF);
Ty = Context.getObjCConstantStringInterface();
Ty = Context.getPointerType(Ty);
} else {
- // If there is no NSConstantString interface defined then treat constant
+ // If there is no NSString interface defined then treat constant
// strings as untyped objects and let the runtime figure it out later.
Ty = Context.getObjCIdType();
}