<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 10, 2015, at 10:19 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 Thu, Sep 10, 2015 at 10:18 AM, David Blaikie<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:dblaikie@gmail.com" target="_blank" class="">dblaikie@gmail.com</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;"><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote"><div class=""><div class="h5">On Thu, Sep 10, 2015 at 10:13 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: Thu Sep 10 12:13:31 2015<br class="">New Revision: 247303<br class=""><br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=247303&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=247303&view=rev</a><br class="">Log:<br class="">Debug Info: Remove an unnecessary debug type visitor.<br class="">Thanks to dblaikie for spotting this.<br class=""><br class="">Modified:<br class="">   <span class="Apple-converted-space"> </span>cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp<br class="">   <span class="Apple-converted-space"> </span>cfe/trunk/test/Modules/ModuleDebugInfo.cpp<br class=""><br class="">Modified: cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp?rev=247303&r1=247302&r2=247303&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp?rev=247303&r1=247302&r2=247303&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp (original)<br class="">+++ cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp Thu Sep 10 12:13:31 2015<br class="">@@ -70,13 +70,6 @@ class PCHContainerGenerator : public AST<br class="">       return true;<br class="">     }<br class=""><br class="">-    bool VisitValueDecl(ValueDecl *D) {<br class="">-      QualType QualTy = D->getType();<br class="">-      if (!QualTy.isNull() && CanRepresent(QualTy.getTypePtr()))<br class="">-        DI.getOrCreateStandaloneType(QualTy, D->getLocation());<br class="">-      return true;<br class="">-    }<br class="">-<br class="">     bool VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) {<br class="">       QualType QualTy(D->getTypeForDecl(), 0);<br class="">       if (!QualTy.isNull() && CanRepresent(QualTy.getTypePtr()))<br class=""><br class="">Modified: cfe/trunk/test/Modules/ModuleDebugInfo.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/ModuleDebugInfo.cpp?rev=247303&r1=247302&r2=247303&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/ModuleDebugInfo.cpp?rev=247303&r1=247302&r2=247303&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/test/Modules/ModuleDebugInfo.cpp (original)<br class="">+++ cfe/trunk/test/Modules/ModuleDebugInfo.cpp Thu Sep 10 12:13:31 2015<br class="">@@ -7,10 +7,12 @@<br class=""> // RUN: rm -rf %t<br class=""> // RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -g -fmodules -fmodule-format=obj -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t.ll -mllvm -debug-only=pchcontainer &>%t-mod.ll<br class=""> // RUN: cat %t-mod.ll | FileCheck %s<br class="">+// RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-NEG %s<br class=""><br class=""> // PCH:<br class=""> // RUN: %clang_cc1 -triple %itanium_abi_triple -x c++ -std=c++11 -emit-pch -fmodule-format=obj -I %S/Inputs -o %t.pch %S/Inputs/DebugCXX.h -mllvm -debug-only=pchcontainer &>%t-pch.ll<br class=""> // RUN: cat %t-pch.ll | FileCheck %s<br class="">+// RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-NEG %s<br class=""><br class=""> #ifdef MODULES<br class=""> @import DebugCXX;<br class="">@@ -30,12 +32,11 @@<br class=""> // CHECK: !DICompositeType(tag: DW_TAG_class_type,<br class=""> // CHECK-SAME:             name: "Template<float, DebugCXX::traits<float> >"<br class=""> // CHECK-SAME:             identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE")<br class="">-// CHECK: !DICompositeType(tag: DW_TAG_class_type,<br class="">-// CHECK-SAME:             name: "Template<long, DebugCXX::traits<long> >"<br class="">-// CHECK-SAME:             identifier: "_ZTSN8DebugCXX8TemplateIlNS_6traitsIlEEEE")<br class=""> // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "A<void>"<br class=""> // CHECK-SAME:             identifier: "_ZTSN8DebugCXX1AIJvEEE")<br class=""> // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "FloatInstatiation"<br class=""> // no mangled name here yet.<br class=""> // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "B",<br class=""> // no mangled name here yet.<br class="">+<br class="">+// CHECK-NEG-NOT: "_ZTSN8DebugCXX8TemplateIlNS_6traitsIlEEEE"<br class=""></blockquote></div></div><div class=""><br class="">Rather than using a separate check - maybe do the same sort of thing we do for DWARF testing, CHECK-NOT between each DICompositeType, to ensure we only get the types we intended? (including a CHECK-NOT at the end to ensure there aren't any trailing ones)<br class=""><br class="">But also: How does the current implementation avoid emitting this type? I thought it visited all the type decls, even those not immediately in the module? (you mentioned that was something that you were planning to address in a future patch) Is that not the case? Is this now sufficient to only emit the decls immediately in this module?<br class=""></div></div></div></div></blockquote></div></div></blockquote><div><br class=""></div>It transitively emits all types that are showing up in a type declaration in the module. This type is only instantiated inside a variable declaration.</div><div><br class=""><blockquote type="cite" class=""><div class="gmail_quote"></div></blockquote><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="">(Oh, I guess what might be missing is types referenced from /types/ in this module - types referenced from variable decls only are addressed by this patch, but you still don't want to include a full definition of std::vector just because a type derives from it, has a member of it, etc)<br class=""></div></div></div></blockquote><div><br class=""></div><div>Unless there is a typedef for that instantiation of std::vector in a module I don’t see a way of avoiding this currently.</div><div><br class=""></div>-- adrian<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;"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><span 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;"><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></span></div></div></div></blockquote></div></div></blockquote></div><br class=""></body></html>