<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 11, 2015, at 11:21 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Fri, Sep 11, 2015 at 10:23 AM, Adrian Prantl via cfe-commits<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">Author: adrian<br class="">Date: Fri Sep 11 12:23:08 2015<br class="">New Revision: 247432<br class=""><br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=247432&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=247432&view=rev</a><br class="">Log:<br class="">Module Debugging: Emit forward declarations for types that are defined in<br class="">clang modules, if -dwarf-ext-refs (DebugTypesExtRefs) is specified.<br class=""><br class="">This reimplements r247369 in about a third of the amount of code.<br class="">Thanks to David Blaikie pointing this out in post-commit review!<br class=""><br class="">Added:<br class="">   <span class="Apple-converted-space"> </span>cfe/trunk/test/Modules/ExtDebugInfo.cpp<br class="">   <span class="Apple-converted-space"> </span>cfe/trunk/test/Modules/ExtDebugInfo.m<br class="">Modified:<br class="">   <span class="Apple-converted-space"> </span>cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br class="">   <span class="Apple-converted-space"> </span>cfe/trunk/lib/CodeGen/CGDebugInfo.h<br class=""><br class="">Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=247432&r1=247431&r2=247432&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=247432&r1=247431&r2=247432&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)<br class="">+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Sep 11 12:23:08 2015<br class="">@@ -148,7 +148,9 @@ void CGDebugInfo::setLocation(SourceLoca<br class=""> }<br class=""><br class=""> llvm::DIScope *CGDebugInfo::getDeclContextDescriptor(const Decl *D) {<br class="">-  return getContextDescriptor(cast<Decl>(D->getDeclContext()), TheCU);<br class="">+  llvm::DIScope *Mod = getParentModuleOrNull(D);<br class="">+  return getContextDescriptor(cast<Decl>(D->getDeclContext()),<br class="">+                              Mod ? Mod : TheCU);<br class=""></blockquote><div class=""><br class=""></div><div class="">Might've been nice to separate the module-parenting part of the change, smaller patches (easier to revert, review, etc), the usual stuff.</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"> }<br class=""><br class=""> llvm::DIScope *CGDebugInfo::getContextDescriptor(const Decl *Context,<br class="">@@ -1448,6 +1450,9 @@ void CGDebugInfo::completeRequiredType(c<br class="">     if (CXXDecl->isDynamicClass())<br class="">       return;<br class=""><br class="">+  if (DebugTypeExtRefs && RD->isFromASTFile())<br class="">+    return;<br class="">+<br class="">   QualType Ty = CGM.getContext().getRecordType(RD);<br class="">   llvm::DIType *T = getTypeOrNull(Ty);<br class="">   if (T && T->isForwardDecl())<br class="">@@ -1478,8 +1483,19 @@ static bool hasExplicitMemberDefinition(<br class=""> }<br class=""><br class=""> static bool shouldOmitDefinition(CodeGenOptions::DebugInfoKind DebugKind,<br class="">+                                 bool DebugTypeExtRefs,<br class="">                                 <span class="Apple-converted-space"> </span>const RecordDecl *RD,<br class="">                                 <span class="Apple-converted-space"> </span>const LangOptions &LangOpts) {<br class="">+  // Does the type exist in an imported clang module?<br class="">+  if (DebugTypeExtRefs && RD->isFromASTFile()) {<br class="">+    if (auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(RD))<br class="">+      if (CTSD->isExplicitInstantiationOrSpecialization())<br class="">+        // We may not assume that this type made it into the module.<br class=""></blockquote><div class=""><br class=""></div><div class="">I guess you mean "we may assume this type made it into the module"? (the "not" seems erroneous - but perhaps I'm misparsing the sentence?)</div></div></div></blockquote><br class=""></div><div>Yes, I inverted the condition without inverting the comment.</div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">+        return true;<br class=""></blockquote><div class=""><br class=""></div><div class="">Does this case ^ actually do anything? (aren't all these instantiations going to be definitions anyway? so if you removed that code the below would return true anyway, wouldn't it?)</div></div></div></blockquote><div><br class=""></div><div>Good catch! I removed the condition.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">+    if (RD->getDefinition())<br class="">+      return true;<br class="">+  }<br class="">+<br class="">   if (DebugKind > CodeGenOptions::LimitedDebugInfo)<br class="">     return false;<br class=""><br class="">@@ -1513,7 +1529,8 @@ static bool shouldOmitDefinition(CodeGen<br class=""> llvm::DIType *CGDebugInfo::CreateType(const RecordType *Ty) {<br class="">   RecordDecl *RD = Ty->getDecl();<br class="">   llvm::DIType *T = cast_or_null<llvm::DIType>(getTypeOrNull(QualType(Ty, 0)));<br class="">-  if (T || shouldOmitDefinition(DebugKind, RD, CGM.getLangOpts())) {<br class="">+  if (T || shouldOmitDefinition(DebugKind, DebugTypeExtRefs, RD,<br class="">+                                CGM.getLangOpts())) {<br class="">     if (!T)<br class="">       T = getOrCreateRecordFwdDecl(Ty, getDeclContextDescriptor(RD));<br class="">     return T;<br class="">@@ -1616,6 +1633,12 @@ llvm::DIType *CGDebugInfo::CreateType(co<br class="">   if (!ID)<br class="">     return nullptr;<br class=""><br class="">+  // Return a forward declaration if this type was imported from a clang module.<br class=""></blockquote><div class=""><br class=""></div><div class="">What's this extra code needed for? Isn't this what shouldOmitDefinition already does? It causes calls to getOrCreateRecordFwdDecl and so we should never get into the CreateTypeDefinition function for the type.</div></div></div></blockquote><div><br class=""></div>An ObjCInterfaceType is not a RecordDecl, so we have to replicate this here.<br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">+  if (DebugTypeExtRefs && ID->isFromASTFile() && ID->getDefinition())<br class="">+    return DBuilder.createForwardDecl(llvm::dwarf::DW_TAG_structure_type,<br class="">+                                      ID->getName(),<br class="">+                                      getDeclContextDescriptor(ID), Unit, 0);<br class="">+<br class="">   // Get overall information about the record type for the debug info.<br class="">   llvm::DIFile *DefUnit = getOrCreateFile(ID->getLocation());<br class="">   unsigned Line = getLineNumber(ID->getLocation());<br class="">@@ -1669,9 +1692,9 @@ CGDebugInfo::getOrCreateModuleRef(Extern<br class="">       TheCU->getSourceLanguage(), internString(Mod.ModuleName),<br class="">       internString(Mod.Path), TheCU->getProducer(), true, StringRef(), 0,<br class="">       internString(Mod.ASTFile), llvm::DIBuilder::FullDebug, Mod.Signature);<br class="">-  llvm::DIModule *M =<br class="">-      DIB.createModule(CU, Mod.ModuleName, ConfigMacros, internString(Mod.Path),<br class="">-                       internString(CGM.getHeaderSearchOpts().Sysroot));<br class="">+  llvm::DIModule *M = DIB.createModule(<br class="">+      CU, Mod.ModuleName, ConfigMacros, internString(Mod.Path),<br class="">+      internString(CGM.getHeaderSearchOpts().Sysroot));<br class=""></blockquote><div class=""><br class=""></div><div class="">This is just reformatting, yes? (stared at it for a while & couldn't spot the difference)</div></div></div></blockquote><div><br class=""></div><div>Sorry, yes.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">   DIB.finalize();<br class="">   ModRef.reset(M);<br class="">   return M;<br class="">@@ -1930,6 +1953,7 @@ llvm::DIType *CGDebugInfo::CreateType(co<br class=""><br class=""> llvm::DIType *CGDebugInfo::CreateEnumType(const EnumType *Ty) {<br class="">   const EnumDecl *ED = Ty->getDecl();<br class="">+<br class="">   uint64_t Size = 0;<br class="">   uint64_t Align = 0;<br class="">   if (!ED->getTypeForDecl()->isIncompleteType()) {<br class="">@@ -1939,9 +1963,12 @@ llvm::DIType *CGDebugInfo::CreateEnumTyp<br class=""><br class="">   SmallString<256> FullName = getUniqueTagTypeName(Ty, CGM, TheCU);<br class=""><br class="">+  bool isImportedFromModule =<br class="">+      DebugTypeExtRefs && ED->isFromASTFile() && ED->getDefinition();<br class="">+<br class=""></blockquote><div class=""><br class=""></div><div class="">Again, seems like code that shouldn't be here - shouldOmitDefinition returning true should mean that getOrCreateRecordFwdDecl is called and we never reach into the concrete CreateXXX functions.</div></div></div></blockquote><div><br class=""></div><div>Again, an EnumDecl is not a RecordDecl (<a href="http://clang.llvm.org/doxygen/classclang_1_1TagDecl.html" class="">http://clang.llvm.org/doxygen/classclang_1_1TagDecl.html</a>). Am I missing something obvious here?</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">   // If this is just a forward declaration, construct an appropriately<br class="">   // marked node and just return it.<br class="">-  if (!ED->getDefinition()) {<br class="">+  if (isImportedFromModule || !ED->getDefinition()) {<br class="">     llvm::DIScope *EDContext = getDeclContextDescriptor(ED);<br class="">     llvm::DIFile *DefUnit = getOrCreateFile(ED->getLocation());<br class="">     unsigned Line = getLineNumber(ED->getLocation());<br class="">@@ -2081,9 +2108,8 @@ llvm::DIType *CGDebugInfo::getOrCreateTy<br class="">   if (auto *T = getTypeOrNull(Ty))<br class="">     return T;<br class=""><br class="">-  // Otherwise create the type.<br class="">   llvm::DIType *Res = CreateTypeNode(Ty, Unit);<br class="">-  void *TyPtr = Ty.getAsOpaquePtr();<br class="">+  void* TyPtr = Ty.getAsOpaquePtr();<br class=""><br class="">   // And update the type cache.<br class="">   TypeCache[TyPtr].reset(Res);<br class="">@@ -2115,6 +2141,19 @@ ObjCInterfaceDecl *CGDebugInfo::getObjCI<br class="">   }<br class=""> }<br class=""><br class="">+llvm::DIModule *CGDebugInfo::getParentModuleOrNull(const Decl *D) {<br class="">+  if (!DebugTypeExtRefs || !D || !D->isFromASTFile())<br class=""></blockquote><div class=""><br class=""></div><div class="">Is a null Decl valid here? What's that for?</div></div></div></blockquote><div><br class=""></div>Removed.<br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">+    return nullptr;<br class="">+<br class="">+  llvm::DIModule *ModuleRef = nullptr;<br class="">+  auto *Reader = CGM.getContext().getExternalSource();<br class="">+  auto Idx = D->getOwningModuleID();<br class="">+  auto Info = Reader->getSourceDescriptor(Idx);<br class="">+  if (Info)<br class="">+    ModuleRef = getOrCreateModuleRef(*Info);<br class="">+  return ModuleRef;<br class="">+}<br class="">+<br class=""> llvm::DIType *CGDebugInfo::CreateTypeNode(QualType Ty, llvm::DIFile *Unit) {<br class="">   // Handle qualifiers, which recursively handles what they refer to.<br class="">   if (Ty.hasLocalQualifiers())<br class="">@@ -2325,8 +2364,10 @@ void CGDebugInfo::collectFunctionDeclPro<br class="">         dyn_cast_or_null<NamespaceDecl>(FD->getDeclContext()))<br class="">       FDContext = getOrCreateNameSpace(NSDecl);<br class="">     else if (const RecordDecl *RDecl =<br class="">-             dyn_cast_or_null<RecordDecl>(FD->getDeclContext()))<br class="">-      FDContext = getContextDescriptor(RDecl, TheCU);<br class="">+             dyn_cast_or_null<RecordDecl>(FD->getDeclContext())) {<br class="">+      llvm::DIScope *Mod = getParentModuleOrNull(RDecl);<br class="">+      FDContext = getContextDescriptor(RDecl, Mod ? Mod : TheCU);<br class="">+    }<br class="">     // Collect template parameters.<br class="">     TParamsArray = CollectFunctionTemplateParams(FD, Unit);<br class="">   }<br class="">@@ -2374,7 +2415,9 @@ void CGDebugInfo::collectVarDeclProps(co<br class="">   // outside the class by putting it in the global scope.<br class="">   if (DC->isRecord())<br class="">     DC = CGM.getContext().getTranslationUnitDecl();<br class="">-  VDContext = getContextDescriptor(cast<Decl>(DC), TheCU);<br class="">+<br class="">+ llvm::DIScope *Mod = getParentModuleOrNull(VD);<br class="">+ VDContext = getContextDescriptor(cast<Decl>(DC), Mod ? Mod : TheCU);<br class=""></blockquote><div class=""><br class="">I'm not quite seeing why this (& the other two/three cases) aren't using the <span style="font-family: monospace;" class="">getDeclContextDescriptor helper you added? Could you explain it to me?</span></div></div></div></blockquote><div><br class=""></div><div>They are either manually picking a DeclContext different than the one returned by Decl->GetDeclContext(), or they are using the Decl as its own DeclContext.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"> }<br class=""><br class=""> llvm::DISubprogram *<br class="">@@ -3299,7 +3342,8 @@ void CGDebugInfo::EmitGlobalVariable(con<br class=""> llvm::DIScope *CGDebugInfo::getCurrentContextDescriptor(const Decl *D) {<br class="">   if (!LexicalBlockStack.empty())<br class="">     return LexicalBlockStack.back();<br class="">-  return getContextDescriptor(D, TheCU);<br class="">+  llvm::DIScope *Mod = getParentModuleOrNull(D);<br class="">+  return getContextDescriptor(D, Mod ? Mod : TheCU);<br class=""> }<br class=""><br class=""> void CGDebugInfo::EmitUsingDirective(const UsingDirectiveDecl &UD) {<br class=""><br class="">Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.h<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=247432&r1=247431&r2=247432&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=247432&r1=247431&r2=247432&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/lib/CodeGen/CGDebugInfo.h (original)<br class="">+++ cfe/trunk/lib/CodeGen/CGDebugInfo.h Fri Sep 11 12:23:08 2015<br class="">@@ -397,6 +397,9 @@ private:<br class="">   llvm::DIModule *<br class="">   getOrCreateModuleRef(ExternalASTSource::ASTSourceDescriptor Mod);<br class=""><br class="">+  /// DebugTypeExtRefs: If \p D originated in a clang module, return it.<br class="">+  llvm::DIModule *getParentModuleOrNull(const Decl *D);<br class="">+<br class="">   /// Get the type from the cache or create a new partial type if<br class="">   /// necessary.<br class="">   llvm::DICompositeType *getOrCreateLimitedType(const RecordType *Ty,<br class=""><br class="">Added: cfe/trunk/test/Modules/ExtDebugInfo.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/ExtDebugInfo.cpp?rev=247432&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/ExtDebugInfo.cpp?rev=247432&view=auto</a><br class="">==============================================================================<br class="">--- cfe/trunk/test/Modules/ExtDebugInfo.cpp (added)<br class="">+++ cfe/trunk/test/Modules/ExtDebugInfo.cpp Fri Sep 11 12:23:08 2015<br class="">@@ -0,0 +1,69 @@<br class="">+// RUN: rm -rf %t<br class="">+// Test that only forward declarations are emitted for types dfined in modules.<br class="">+<br class="">+// Modules:<br class="">+// RUN: %clang_cc1 -x objective-c++ -std=c++11 -g -dwarf-ext-refs -fmodules \<br class="">+// RUN:     -fmodule-format=obj -fimplicit-module-maps -DMODULES \<br class="">+// RUN:     -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t-mod.ll<br class="">+// RUN: cat %t-mod.ll |  FileCheck %s<br class="">+<br class="">+// PCH:<br class="">+// RUN: %clang_cc1 -x c++ -std=c++11 -fmodule-format=obj -emit-pch -I%S/Inputs \<br class="">+// RUN:     -o %t.pch %S/Inputs/DebugCXX.h<br class="">+// RUN: %clang_cc1 -std=c++11 -g -dwarf-ext-refs -fmodule-format=obj \<br class="">+// RUN:     -include-pch %t.pch %s -emit-llvm -o %t-pch.ll %s<br class="">+// RUN: cat %t-pch.ll |  FileCheck %s<br class="">+<br class="">+#ifdef MODULES<br class="">+@import DebugCXX;<br class="">+#endif<br class="">+<br class="">+using DebugCXX::Struct;<br class="">+<br class="">+Struct s;<br class="">+DebugCXX::Enum e;<br class="">+DebugCXX::Template<long> implicitTemplate;<br class="">+DebugCXX::Template<int> explicitTemplate;<br class="">+DebugCXX::FloatInstatiation typedefTemplate;<br class="">+int Struct::static_member = -1;<br class="">+enum {<br class="">+  e3 = -1<br class="">+} conflicting_uid = e3;<br class="">+auto anon_enum = DebugCXX::e2;<br class="">+char _anchor = anon_enum + conflicting_uid;<br class="">+<br class="">+// CHECK: ![[NS:.*]] = !DINamespace(name: "DebugCXX", scope: ![[MOD:[0-9]+]],<br class="">+// CHECK: ![[MOD]] = !DIModule(scope: null, name: {{.*}}DebugCXX<br class="">+<br class="">+// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Struct",<br class="">+// CHECK-SAME:             scope: ![[NS]],<br class="">+// CHECK-SAME:             flags: DIFlagFwdDecl,<br class="">+// CHECK-SAME:             identifier: "_ZTSN8DebugCXX6StructE")<br class="">+<br class="">+// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Enum",<br class="">+// CHECK-SAME:             scope: ![[NS]],<br class="">+// CHECK-SAME:             flags: DIFlagFwdDecl,<br class="">+// CHECK-SAME:             identifier:  "_ZTSN8DebugCXX4EnumE")<br class="">+<br class="">+// CHECK: !DICompositeType(tag: DW_TAG_class_type,<br class="">+<br class="">+// CHECK: !DICompositeType(tag: DW_TAG_class_type,<br class="">+// CHECK-SAME:             name: "Template<int, DebugCXX::traits<int> >",<br class="">+// CHECK-SAME:             scope: ![[NS]],<br class="">+// CHECK-SAME:             flags: DIFlagFwdDecl,<br class="">+// CHECK-SAME:             identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE")<br class="">+<br class="">+// CHECK: !DICompositeType(tag: DW_TAG_class_type,<br class="">+// CHECK-SAME:             name: "Template<float, DebugCXX::traits<float> >",<br class="">+// CHECK-SAME:             scope: ![[NS]],<br class="">+// CHECK-SAME:             flags: DIFlagFwdDecl,<br class="">+// CHECK-SAME:             identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE")<br class="">+<br class="">+// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "static_member",<br class="">+// CHECK-SAME:           scope: !"_ZTSN8DebugCXX6StructE"<br class="">+<br class="">+// CHECK: !DIGlobalVariable(name: "anon_enum", {{.*}}, type: ![[ANON_ENUM:[0-9]+]]<br class="">+// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, scope: ![[NS]],<br class="">+// CHECK-SAME:             line: 16<br class="">+<br class="">+// CHECK: !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !0, entity: !"_ZTSN8DebugCXX6StructE", line: 21)<br class=""><br class="">Added: cfe/trunk/test/Modules/ExtDebugInfo.m<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/ExtDebugInfo.m?rev=247432&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/ExtDebugInfo.m?rev=247432&view=auto</a><br class="">==============================================================================<br class="">--- cfe/trunk/test/Modules/ExtDebugInfo.m (added)<br class="">+++ cfe/trunk/test/Modules/ExtDebugInfo.m Fri Sep 11 12:23:08 2015<br class="">@@ -0,0 +1,29 @@<br class="">+// RUN: rm -rf %t<br class="">+// Test that only forward declarations are emitted for types dfined in modules.<br class=""></blockquote><div class=""><br class=""></div><div class="">Typo "dfined".<br class=""><br class="">I don't see where/how this test is testing for forward declarations - it doesn't seem to test for any declarations or definitions. (they could be emitted as either, or not emitted at all?)</div></div></div></blockquote><div><br class=""></div>I made it stricter now.</div><div><br class=""></div><div>thanks!</div><div>adrian</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">+<br class="">+// Modules:<br class="">+// RUN: %clang_cc1 -x objective-c -g -dwarf-ext-refs -fmodules \<br class="">+// RUN:     -fmodule-format=obj -fimplicit-module-maps -DMODULES \<br class="">+// RUN:     -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t-mod.ll<br class="">+// RUN: cat %t-mod.ll |  FileCheck %s<br class="">+<br class="">+// PCH:<br class="">+// RUN: %clang_cc1 -x objective-c -fmodule-format=obj -emit-pch -I%S/Inputs \<br class="">+// RUN:     -o %t.pch %S/Inputs/DebugObjC.h<br class="">+// RUN: %clang_cc1 -x objective-c -g -dwarf-ext-refs -fmodule-format=obj \<br class="">+// RUN:     -include-pch %t.pch %s -emit-llvm -o %t-pch.ll %s<br class="">+// RUN: cat %t-pch.ll |  FileCheck %s<br class="">+<br class="">+#ifdef MODULES<br class="">+@import DebugObjC;<br class="">+#endif<br class="">+<br class="">+int foo(ObjCClass *c) {<br class="">+  [c instanceMethodWithInt: 0];<br class="">+  return [c property];<br class="">+}<br class="">+<br class="">+// CHECK: !DICompositeType(tag: DW_TAG_structure_type,<br class="">+// CHECK-SAME:             scope: ![[MOD:[0-9]+]],<br class="">+// CHECK-SAME:             flags: DIFlagFwdDecl)<br class="">+// CHECK: ![[MOD]] = !DIModule(scope: null, name: {{.*}}DebugObjC </blockquote><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><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></blockquote></div></div></blockquote></div><br class=""></body></html>