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