<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Sorry, I didn't mean to imply it’s *only* usable on Darwin.  CoreFoundation (or at least a large subset of it) supports other platforms.  And in general, these builtins are exposed in all languages and for all platforms, and have been “forever” so there could be other users of this functionality that I’m not aware of.</div><div class=""><br class=""></div><div class="">Ben</div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Apr 11, 2016, at 7:58 AM, Yaron Keren <<a href="mailto:yaron.keren@gmail.com" class="">yaron.keren@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="rtl" class=""><div dir="ltr" class="">If used only for Darwin, could this depend on Target.getTriple().isOSDarwin() ?</div><div dir="ltr" class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote"><div dir="ltr" class="">2016-04-11 17:18 GMT+03:00 Ben Langmuir <span dir="ltr" class=""><<a href="mailto:blangmuir@apple.com" target="_blank" class="">blangmuir@apple.com</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 .8ex;border-left:1px #ccc solid;border-right:1px #ccc solid;padding-left:1ex;padding-right:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Apr 3, 2016, at 10:57 AM, Yaron Keren <<a href="mailto:yaron.keren@gmail.com" target="_blank" class="">yaron.keren@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="rtl" class=""><div dir="ltr" class="">I look at many AST dumps for small reduced code so it's mostly weird to see this in the AST (and takes a bit of screen real estate) as it's not something that originated in the code. </div><div dir="ltr" class="">By now I'm used to ignoring it but would expect NSConstantString would baffle new clang programmers. It would be nice if we won't see it...</div><div dir="ltr" class="">How is NSConstantString used outside ObjectiveC ?</div></div></div></blockquote><div class=""><br class=""></div></span><div class="">A builtin that uses this type is exposed as the CFSTR() macro in CoreFoundation on Darwin platforms - this is a C framework that needs to be usable from C, Objective C and C++.</div><div class=""><br class=""></div><div class="">Sorry for the slow reply!</div><div class=""><div class="h5"><br class=""><blockquote type="cite" class=""><div class=""><div dir="rtl" class=""><div dir="ltr" class=""><br class=""></div><div dir="ltr" class=""><br class=""></div><div dir="ltr" class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote"><div dir="ltr" class="">2016-04-03 20:39 GMT+03:00 Ben Langmuir <span dir="ltr" class=""><<a href="mailto:blangmuir@apple.com" target="_blank" class="">blangmuir@apple.com</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 .8ex;border-left:1px #ccc solid;border-right:1px #ccc solid;padding-left:1ex;padding-right:1ex"><div style="word-wrap:break-word" class="">This type and the builtin it supports needs to work in C/C++ as well, not just Objective-C.   Are you running into a problem here, or is it just “weird” to see it in the AST?<div class=""><div class=""><div class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Apr 3, 2016, at 5:21 AM, Yaron Keren <<a href="mailto:yaron.keren@gmail.com" target="_blank" class="">yaron.keren@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="rtl" class=""><div dir="ltr" class="">+1, if possible. There is a if (getLangOpts().ObjC1) block just before this.</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote"><div dir="ltr" class="">2016-04-03 14:21 GMT+03:00 Vassil Vassilev via cfe-commits <span dir="ltr" class=""><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 04/02/16 01:55, Ben Langmuir via cfe-commits wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: benlangmuir<br class="">
Date: Wed Feb  3 18:55:24 2016<br class="">
New Revision: 259734<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=259734&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=259734&view=rev</a><br class="">
Log:<br class="">
Fix predefine for __NSConstantString struct type<br class="">
<br class="">
Per review feedback the name was wrong and it can be used outside<br class="">
Objective-C.<br class="">
<br class="">
Unfortunately, making the internal struct visible broke some ASTMatchers<br class="">
tests that assumed that the first record decl would be from user code,<br class="">
rather than a builtin type.  I'm worried that this will also affect<br class="">
users' code.  So this patch adds a typedef to wrap the internal struct<br class="">
and only makes the typedef visible to namelookup.  This is sufficient to<br class="">
allow the ASTReader to merge the decls we need without making the struct<br class="">
itself visible.<br class="">
<br class="">
<a class="">rdar://problem/24425801</a><br class="">
<br class="">
Modified:<br class="">
     cfe/trunk/include/clang/AST/ASTContext.h<br class="">
     cfe/trunk/include/clang/Serialization/ASTBitCodes.h<br class="">
     cfe/trunk/lib/AST/ASTContext.cpp<br class="">
     cfe/trunk/lib/Sema/Sema.cpp<br class="">
     cfe/trunk/lib/Serialization/ASTReader.cpp<br class="">
     cfe/trunk/lib/Serialization/ASTWriter.cpp<br class="">
     cfe/trunk/test/CodeGenObjC/2010-02-01-utf16-with-null.m<br class="">
     cfe/trunk/test/CodeGenObjC/arc-no-arc-exceptions.m<br class="">
     cfe/trunk/test/CodeGenObjC/tentative-cfconstantstring.m<br class="">
     cfe/trunk/test/Modules/Inputs/builtin.h<br class="">
     cfe/trunk/test/Modules/builtins.m<br class="">
<br class="">
Modified: cfe/trunk/include/clang/AST/ASTContext.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=259734&r1=259733&r2=259734&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=259734&r1=259733&r2=259734&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/include/clang/AST/ASTContext.h (original)<br class="">
+++ cfe/trunk/include/clang/AST/ASTContext.h Wed Feb  3 18:55:24 2016<br class="">
@@ -253,8 +253,9 @@ class ASTContext : public RefCountedBase<br class="">
    mutable IdentifierInfo *MakeIntegerSeqName = nullptr;<br class="">
      QualType ObjCConstantStringType;<br class="">
-  mutable RecordDecl *CFConstantStringTypeDecl;<br class="">
-<br class="">
+  mutable RecordDecl *CFConstantStringTagDecl;<br class="">
+  mutable TypedefDecl *CFConstantStringTypeDecl;<br class="">
+<br class="">
    mutable QualType ObjCSuperType;<br class="">
        QualType ObjCNSStringType;<br class="">
@@ -1381,11 +1382,12 @@ public:<br class="">
    /// if it hasn't yet been built.<br class="">
    QualType getRawCFConstantStringType() const {<br class="">
      if (CFConstantStringTypeDecl)<br class="">
-      return getTagDeclType(CFConstantStringTypeDecl);<br class="">
+      return getTypedefType(CFConstantStringTypeDecl);<br class="">
      return QualType();<br class="">
    }<br class="">
    void setCFConstantStringType(QualType T);<br class="">
-  TagDecl *getCFConstantStringDecl() const;<br class="">
+  TypedefDecl *getCFConstantStringDecl() const;<br class="">
+  RecordDecl *getCFConstantStringTagDecl() const;<br class="">
      // This setter/getter represents the ObjC type for an NSConstantString.<br class="">
    void setObjCConstantStringInterface(ObjCInterfaceDecl *Decl);<br class="">
<br class="">
Modified: cfe/trunk/include/clang/Serialization/ASTBitCodes.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTBitCodes.h?rev=259734&r1=259733&r2=259734&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTBitCodes.h?rev=259734&r1=259733&r2=259734&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/include/clang/Serialization/ASTBitCodes.h (original)<br class="">
+++ cfe/trunk/include/clang/Serialization/ASTBitCodes.h Wed Feb  3 18:55:24 2016<br class="">
@@ -988,15 +988,18 @@ namespace clang {<br class="">
        /// \brief The internal '__make_integer_seq' template.<br class="">
        PREDEF_DECL_MAKE_INTEGER_SEQ_ID = 13,<br class="">
  -      /// \brief The internal '__NSConstantString' type.<br class="">
+      /// \brief The internal '__NSConstantString' typedef.<br class="">
        PREDEF_DECL_CF_CONSTANT_STRING_ID = 14,<br class="">
+<br class="">
+      /// \brief The internal '__NSConstantString' tag type.<br class="">
+      PREDEF_DECL_CF_CONSTANT_STRING_TAG_ID = 15,<br class="">
      };<br class="">
        /// \brief The number of declaration IDs that are predefined.<br class="">
      ///<br class="">
      /// For more information about predefined declarations, see the<br class="">
      /// \c PredefinedDeclIDs type and the PREDEF_DECL_*_ID constants.<br class="">
-    const unsigned int NUM_PREDEF_DECL_IDS = 15;<br class="">
+    const unsigned int NUM_PREDEF_DECL_IDS = 16;<br class="">
        /// \brief Record code for a list of local redeclarations of a declaration.<br class="">
      const unsigned int LOCAL_REDECLARATIONS = 50;<br class="">
<br class="">
Modified: cfe/trunk/lib/AST/ASTContext.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=259734&r1=259733&r2=259734&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=259734&r1=259733&r2=259734&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/lib/AST/ASTContext.cpp (original)<br class="">
+++ cfe/trunk/lib/AST/ASTContext.cpp Wed Feb  3 18:55:24 2016<br class="">
@@ -738,12 +738,13 @@ ASTContext::ASTContext(LangOptions &LOpt<br class="">
        BuiltinVaListDecl(nullptr), BuiltinMSVaListDecl(nullptr),<br class="">
        ObjCIdDecl(nullptr), ObjCSelDecl(nullptr), ObjCClassDecl(nullptr),<br class="">
        ObjCProtocolClassDecl(nullptr), BOOLDecl(nullptr),<br class="">
-      CFConstantStringTypeDecl(nullptr), ObjCInstanceTypeDecl(nullptr),<br class="">
-      FILEDecl(nullptr), jmp_bufDecl(nullptr), sigjmp_bufDecl(nullptr),<br class="">
-      ucontext_tDecl(nullptr), BlockDescriptorType(nullptr),<br class="">
-      BlockDescriptorExtendedType(nullptr), cudaConfigureCallDecl(nullptr),<br class="">
-      FirstLocalImport(), LastLocalImport(), ExternCContext(nullptr),<br class="">
-      MakeIntegerSeqDecl(nullptr), SourceMgr(SM), LangOpts(LOpts),<br class="">
+      CFConstantStringTagDecl(nullptr), CFConstantStringTypeDecl(nullptr),<br class="">
+      ObjCInstanceTypeDecl(nullptr), FILEDecl(nullptr), jmp_bufDecl(nullptr),<br class="">
+      sigjmp_bufDecl(nullptr), ucontext_tDecl(nullptr),<br class="">
+      BlockDescriptorType(nullptr), BlockDescriptorExtendedType(nullptr),<br class="">
+      cudaConfigureCallDecl(nullptr), FirstLocalImport(), LastLocalImport(),<br class="">
+      ExternCContext(nullptr), MakeIntegerSeqDecl(nullptr), SourceMgr(SM),<br class="">
+      LangOpts(LOpts),<br class="">
        SanitizerBL(new SanitizerBlacklist(LangOpts.SanitizerBlacklistFiles, SM)),<br class="">
        AddrSpaceMap(nullptr), Target(nullptr), AuxTarget(nullptr),<br class="">
        PrintingPolicy(LOpts), Idents(idents), Selectors(sels),<br class="">
@@ -4868,12 +4869,12 @@ int ASTContext::getIntegerTypeOrder(Qual<br class="">
    return 1;<br class="">
  }<br class="">
  -TagDecl *ASTContext::getCFConstantStringDecl() const {<br class="">
+TypedefDecl *ASTContext::getCFConstantStringDecl() const {<br class="">
    if (!CFConstantStringTypeDecl) {<br class="">
-    // This type is designed to be compatible with NSConstantString, but cannot<br class="">
-    // use the same name, since NSConstantString is an interface.<br class="">
-    CFConstantStringTypeDecl = buildImplicitRecord("__NSConstantString");<br class="">
-    CFConstantStringTypeDecl->startDefinition();<br class="">
+    assert(!CFConstantStringTagDecl &&<br class="">
+           "tag and typedef should be initialized together");<br class="">
+    CFConstantStringTagDecl = buildImplicitRecord("__NSConstantString_tag");<br class="">
+    CFConstantStringTagDecl->startDefinition();<br class="">
        QualType FieldTypes[4];<br class="">
  @@ -4888,7 +4889,7 @@ TagDecl *ASTContext::getCFConstantString<br class="">
        // Create fields<br class="">
      for (unsigned i = 0; i < 4; ++i) {<br class="">
-      FieldDecl *Field = FieldDecl::Create(*this, CFConstantStringTypeDecl,<br class="">
+      FieldDecl *Field = FieldDecl::Create(*this, CFConstantStringTagDecl,<br class="">
                                             SourceLocation(),<br class="">
                                             SourceLocation(), nullptr,<br class="">
                                             FieldTypes[i], /*TInfo=*/nullptr,<br class="">
@@ -4896,18 +4897,29 @@ TagDecl *ASTContext::getCFConstantString<br class="">
                                             /*Mutable=*/false,<br class="">
                                             ICIS_NoInit);<br class="">
        Field->setAccess(AS_public);<br class="">
-      CFConstantStringTypeDecl->addDecl(Field);<br class="">
+      CFConstantStringTagDecl->addDecl(Field);<br class="">
      }<br class="">
  -    CFConstantStringTypeDecl->completeDefinition();<br class="">
+    CFConstantStringTagDecl->completeDefinition();<br class="">
+    // This type is designed to be compatible with NSConstantString, but cannot<br class="">
+    // use the same name, since NSConstantString is an interface.<br class="">
+    auto tagType = getTagDeclType(CFConstantStringTagDecl);<br class="">
+    CFConstantStringTypeDecl =<br class="">
+        buildImplicitTypedef(tagType, "__NSConstantString");<br class="">
    }<br class="">
      return CFConstantStringTypeDecl;<br class="">
  }<br class="">
  +RecordDecl *ASTContext::getCFConstantStringTagDecl() const {<br class="">
+  if (!CFConstantStringTagDecl)<br class="">
+    getCFConstantStringDecl(); // Build the tag and the typedef.<br class="">
+  return CFConstantStringTagDecl;<br class="">
+}<br class="">
+<br class="">
  // getCFConstantStringType - Return the type used for constant CFStrings.<br class="">
  QualType ASTContext::getCFConstantStringType() const {<br class="">
-  return getTagDeclType(getCFConstantStringDecl());<br class="">
+  return getTypedefType(getCFConstantStringDecl());<br class="">
  }<br class="">
    QualType ASTContext::getObjCSuperType() const {<br class="">
@@ -4920,9 +4932,13 @@ QualType ASTContext::getObjCSuperType()<br class="">
  }<br class="">
    void ASTContext::setCFConstantStringType(QualType T) {<br class="">
-  const RecordType *Rec = T->getAs<RecordType>();<br class="">
-  assert(Rec && "Invalid CFConstantStringType");<br class="">
-  CFConstantStringTypeDecl = Rec->getDecl();<br class="">
+  const TypedefType *TD = T->getAs<TypedefType>();<br class="">
+  assert(TD && "Invalid CFConstantStringType");<br class="">
+  CFConstantStringTypeDecl = cast<TypedefDecl>(TD->getDecl());<br class="">
+  auto TagType =<br class="">
+      CFConstantStringTypeDecl->getUnderlyingType()->getAs<RecordType>();<br class="">
+  assert(TagType && "Invalid CFConstantStringType");<br class="">
+  CFConstantStringTagDecl = TagType->getDecl();<br class="">
  }<br class="">
    QualType ASTContext::getBlockDescriptorType() const {<br class="">
<br class="">
Modified: cfe/trunk/lib/Sema/Sema.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=259734&r1=259733&r2=259734&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=259734&r1=259733&r2=259734&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/lib/Sema/Sema.cpp (original)<br class="">
+++ cfe/trunk/lib/Sema/Sema.cpp Wed Feb  3 18:55:24 2016<br class="">
@@ -189,12 +189,13 @@ void Sema::Initialize() {<br class="">
      DeclarationName Protocol = &Context.Idents.get("Protocol");<br class="">
      if (IdResolver.begin(Protocol) == IdResolver.end())<br class="">
        PushOnScopeChains(Context.getObjCProtocolDecl(), TUScope);<br class="">
-<br class="">
-    DeclarationName ConstantString = &Context.Idents.get("NSConstantString");<br class="">
-    if (IdResolver.begin(ConstantString) == IdResolver.end())<br class="">
-      PushOnScopeChains(Context.getCFConstantStringDecl(), TUScope);<br class="">
    }<br class="">
  +  // Create the internal type for the *StringMakeConstantString builtins.<br class="">
+  DeclarationName ConstantString = &Context.Idents.get("__NSConstantString");<br class="">
+  if (IdResolver.begin(ConstantString) == IdResolver.end())<br class="">
+    PushOnScopeChains(Context.getCFConstantStringDecl(), TUScope);<br class="">
+<br class="">
</blockquote>
Ben, maybe you replied to that somewhere else but could not find it. Could this be a conditional if lang opts are objc? This gets generated for objc independent code:<br class="">
|-TypedefDecl 0x10b8131a8 <<invalid sloc>> <invalid sloc> implicit __NSConstantString 'struct __NSConstantString_tag'<br class="">
| `-RecordType 0x10b812f60 'struct __NSConstantString_tag'<br class="">
|   `-CXXRecord 0x10b812eb8 '__NSConstantString_tag'<br class="">
<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
    // Initialize Microsoft "predefined C++ types".<br class="">
    if (getLangOpts().MSVCCompat) {<br class="">
      if (getLangOpts().CPlusPlus &&<br class="">
<br class="">
Modified: cfe/trunk/lib/Serialization/ASTReader.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=259734&r1=259733&r2=259734&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=259734&r1=259733&r2=259734&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)<br class="">
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Wed Feb  3 18:55:24 2016<br class="">
@@ -6447,6 +6447,9 @@ static Decl *getPredefinedDecl(ASTContex<br class="">
      case PREDEF_DECL_CF_CONSTANT_STRING_ID:<br class="">
      return Context.getCFConstantStringDecl();<br class="">
+<br class="">
+  case PREDEF_DECL_CF_CONSTANT_STRING_TAG_ID:<br class="">
+    return Context.getCFConstantStringTagDecl();<br class="">
    }<br class="">
    llvm_unreachable("PredefinedDeclIDs unknown enum value");<br class="">
  }<br class="">
<br class="">
Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=259734&r1=259733&r2=259734&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=259734&r1=259733&r2=259734&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/lib/Serialization/ASTWriter.cpp (original)<br class="">
+++ cfe/trunk/lib/Serialization/ASTWriter.cpp Wed Feb  3 18:55:24 2016<br class="">
@@ -4154,6 +4154,8 @@ uint64_t ASTWriter::WriteASTCore(Sema &S<br class="">
                       PREDEF_DECL_MAKE_INTEGER_SEQ_ID);<br class="">
    RegisterPredefDecl(Context.CFConstantStringTypeDecl,<br class="">
                       PREDEF_DECL_CF_CONSTANT_STRING_ID);<br class="">
+  RegisterPredefDecl(Context.CFConstantStringTagDecl,<br class="">
+                     PREDEF_DECL_CF_CONSTANT_STRING_TAG_ID);<br class="">
      // Build a record containing all of the tentative definitions in this file, in<br class="">
    // TentativeDefinitions order.  Generally, this record will be empty for<br class="">
<br class="">
Modified: cfe/trunk/test/CodeGenObjC/2010-02-01-utf16-with-null.m<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/2010-02-01-utf16-with-null.m?rev=259734&r1=259733&r2=259734&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/2010-02-01-utf16-with-null.m?rev=259734&r1=259733&r2=259734&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/test/CodeGenObjC/2010-02-01-utf16-with-null.m (original)<br class="">
+++ cfe/trunk/test/CodeGenObjC/2010-02-01-utf16-with-null.m Wed Feb  3 18:55:24 2016<br class="">
@@ -2,6 +2,6 @@<br class="">
  // <a class="">rdar://7589850</a><br class="">
    // CHECK: @.str = private unnamed_addr constant [9 x i16] [i16 103, i16 111, i16 111, i16 100, i16 0, i16 98, i16 121, i16 101, i16 0], section "__TEXT,__ustring", align 2<br class="">
-// CHECK: @_unnamed_cfstring_ = private constant %struct.__NSConstantString { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 2000, i8* bitcast ([9 x i16]* @.str to i8*), i32 8 }, section "__DATA,__cfstring"<br class="">
-// CHECK: @P = global i8* bitcast (%struct.__NSConstantString* @_unnamed_cfstring_ to i8*), align 4<br class="">
+// CHECK: @_unnamed_cfstring_ = private constant %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 2000, i8* bitcast ([9 x i16]* @.str to i8*), i32 8 }, section "__DATA,__cfstring"<br class="">
+// CHECK: @P = global i8* bitcast (%struct.__NSConstantString_tag* @_unnamed_cfstring_ to i8*), align 4<br class="">
  void *P = @"good\0bye";<br class="">
<br class="">
Modified: cfe/trunk/test/CodeGenObjC/arc-no-arc-exceptions.m<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-no-arc-exceptions.m?rev=259734&r1=259733&r2=259734&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-no-arc-exceptions.m?rev=259734&r1=259733&r2=259734&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/test/CodeGenObjC/arc-no-arc-exceptions.m (original)<br class="">
+++ cfe/trunk/test/CodeGenObjC/arc-no-arc-exceptions.m Wed Feb  3 18:55:24 2016<br class="">
@@ -34,7 +34,7 @@ void test1(id x) {<br class="">
  void NSLog(id, ...);<br class="">
    // CHECK-LABEL: define void @test2(<br class="">
-// CHECK: invoke void (i8*, ...) @NSLog(i8* bitcast (%struct.__NSConstantString* @_unnamed_cfstring_ to i8*), i32* %{{.*}})<br class="">
+// CHECK: invoke void (i8*, ...) @NSLog(i8* bitcast (%struct.__NSConstantString_tag* @_unnamed_cfstring_ to i8*), i32* %{{.*}})<br class="">
  // CHECK:   to label %{{.*}} unwind label %{{.*}}, !<a href="http://clang.arc.no/" target="_blank" class="">clang.arc.no</a>_objc_arc_exceptions !<br class="">
  // NO-METADATA-LABEL: define void @test2(<br class="">
  // NO-METADATA-NOT: !<a href="http://clang.arc.no/" target="_blank" class="">clang.arc.no</a>_objc_arc_exceptions<br class="">
<br class="">
Modified: cfe/trunk/test/CodeGenObjC/tentative-cfconstantstring.m<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/tentative-cfconstantstring.m?rev=259734&r1=259733&r2=259734&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/tentative-cfconstantstring.m?rev=259734&r1=259733&r2=259734&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/test/CodeGenObjC/tentative-cfconstantstring.m (original)<br class="">
+++ cfe/trunk/test/CodeGenObjC/tentative-cfconstantstring.m Wed Feb  3 18:55:24 2016<br class="">
@@ -32,12 +32,11 @@ static inline void _inlineFunction() {<br class="">
  @end<br class="">
    // CHECK: @__CFConstantStringClassReference = common global [24 x i32] zeroinitializer, align 16<br class="">
-// CHECK: @_unnamed_cfstring_{{.*}} = private constant %struct.__NSConstantString { i32* getelementptr inbounds ([24 x i32], [24 x i32]* @__CFConstantStringClassReference, i32 0, i32 0)<br class="">
+// CHECK: @_unnamed_cfstring_{{.*}} = private constant %struct.__NSConstantString_tag { i32* getelementptr inbounds ([24 x i32], [24 x i32]* @__CFConstantStringClassReference, i32 0, i32 0)<br class="">
    // CHECK-LABEL: define internal void @_inlineFunction()<br class="">
  // CHECK:  [[ZERO:%.*]] = load %struct._class_t*, %struct._class_t** @"OBJC_CLASSLIST_REFERENCES_<br class="">
  // CHECK-NEXT:   [[ONE:%.*]] = load i8*, i8** @OBJC_SELECTOR_REFERENCES_<br class="">
  // CHECK-NEXT:   [[TWO:%.*]] = bitcast %struct._class_t* [[ZERO]] to i8*<br class="">
-// CHECK-NEXT:   call void (i8*, i8*, [[T:%.*]]*, ...) bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, [[T:%.*]]*, ...)*)(i8* [[TWO]], i8* [[ONE]], [[T:%.*]]* bitcast (%struct.__NSConstantString* @_unnamed_cfstring_{{.*}} to [[T:%.*]]*))<br class="">
+// CHECK-NEXT:   call void (i8*, i8*, [[T:%.*]]*, ...) bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, [[T:%.*]]*, ...)*)(i8* [[TWO]], i8* [[ONE]], [[T:%.*]]* bitcast (%struct.__NSConstantString_tag* @_unnamed_cfstring_{{.*}} to [[T:%.*]]*))<br class="">
  // CHECK-NEXT:   ret void<br class="">
-<br class="">
<br class="">
Modified: cfe/trunk/test/Modules/Inputs/builtin.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/builtin.h?rev=259734&r1=259733&r2=259734&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/builtin.h?rev=259734&r1=259733&r2=259734&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/test/Modules/Inputs/builtin.h (original)<br class="">
+++ cfe/trunk/test/Modules/Inputs/builtin.h Wed Feb  3 18:55:24 2016<br class="">
@@ -1,10 +1,7 @@<br class="">
  int i;<br class="">
  int *p = &i;<br class="">
  -#ifdef __OBJC__<br class="">
  void use_constant_string_builtins(void) {<br class="">
    (void)__builtin___CFStringMakeConstantString("");<br class="">
    (void)__builtin___NSStringMakeConstantString("");<br class="">
  }<br class="">
-#endif<br class="">
-<br class="">
<br class="">
Modified: cfe/trunk/test/Modules/builtins.m<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/builtins.m?rev=259734&r1=259733&r2=259734&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/builtins.m?rev=259734&r1=259733&r2=259734&view=diff</a><br class="">
==============================================================================<br class="">
--- cfe/trunk/test/Modules/builtins.m (original)<br class="">
+++ cfe/trunk/test/Modules/builtins.m Wed Feb  3 18:55:24 2016<br class="">
@@ -1,5 +1,7 @@<br class="">
  // RUN: rm -rf %t<br class="">
  // RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs %s -verify<br class="">
+// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs -x c %s -verify<br class="">
+// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs -x objective-c++ %s -verify<br class="">
    // RUN: rm -rf %t.pch.cache<br class="">
  // RUN: %clang_cc1 -fmodules-cache-path=%t.pch.cache -fmodules -fimplicit-module-maps -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %S/Inputs/use-builtin.h<br class="">
@@ -12,13 +14,13 @@ void use_constant_string_builtins1(void)<br class="">
    (void)__builtin___NSStringMakeConstantString("");<br class="">
  }<br class="">
  -@import builtin;<br class="">
+#include "builtin.h"<br class="">
    int foo() {<br class="">
    return __builtin_object_size(p, 0);<br class="">
  }<br class="">
  -@import builtin.sub;<br class="">
+#include "builtin_sub.h"<br class="">
    int bar() {<br class="">
    return __builtin_object_size(p, 0);<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
cfe-commits mailing list<br class="">
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br class="">
</blockquote>
<br class="">
_______________________________________________<br class="">
cfe-commits mailing list<br class="">
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br class="">
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></div></div></div></blockquote></div><br class=""></div>
</div></blockquote></div></div></div><br class=""></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>