<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>1. It is required for correct debug info emission for NVPTX
target.</p>
<p>2. Not sure, I'm not very familiar with this. Eric?<br>
</p>
<pre class="moz-signature" cols="72">-------------
Best regards,
Alexey Bataev</pre>
<div class="moz-cite-prefix">12.03.2018 11:46, David Blaikie пишет:<br>
</div>
<blockquote type="cite"
cite="mid:CAENS6EsrM2b36ooA1KmqVFR22vYQP_DfXB1LJCtvj6PUoJmuaA@mail.gmail.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div dir="ltr">What's the use-case/motivation? Should this be an
IR feature (on a per-CU basis, so that LTO can correctly respect
some CUs requesting this feature, and some disabling it)</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Mon, Mar 12, 2018 at 8:06 AM Alexey Bataev via
Phabricator via llvm-commits <<a
href="mailto:llvm-commits@lists.llvm.org"
moz-do-not-send="true">llvm-commits@lists.llvm.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">ABataev
created this revision.<br>
ABataev added reviewers: probinson, echristo.<br>
Herald added subscribers: JDevlieghere, aprantl.<br>
<br>
Added a flag -no-dwarf-gnu-pub-sections, which allows to
disable<br>
emission of gnu public sections.<br>
<br>
<br>
Repository:<br>
rL LLVM<br>
<br>
<a
href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD44385&data=02%7C01%7C%7Ce807747c01a941a740d008d588307cfa%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636564664186820313&sdata=CPc5yC5ORdLnrc%2FpoIuOLd%2FjAZFjWEPiiOZVmoPWA%2Bs%3D&reserved=0"
originalsrc="https://reviews.llvm.org/D44385"
shash="y5WM5kPjge2u3QVabI8zjV2Lb9IxxYRAZQhjaOKBDJ2NoIE9Tdn1MYOfMXq00+hzcOVfvFXubn2BDiqOw5d/lHYt5y4xcvrNa+uhbQklTLRyCmjiRywGJiVctyU7uwLVNDeVFhNxzz9cfGHIDpND7ZpZYPzFLoyZTAGni71WmxQ="
rel="noreferrer" target="_blank" moz-do-not-send="true">https://reviews.llvm.org/D44385</a><br>
<br>
Files:<br>
lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br>
lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
lib/CodeGen/AsmPrinter/DwarfDebug.h<br>
test/DebugInfo/X86/no-gnu-public-sections.ll<br>
<br>
<br>
Index: test/DebugInfo/X86/no-gnu-public-sections.ll<br>
===================================================================<br>
--- /dev/null<br>
+++ test/DebugInfo/X86/no-gnu-public-sections.ll<br>
@@ -0,0 +1,31 @@<br>
+; RUN: llc -mtriple=x86_64-pc-linux-gnu -debugger-tune=gdb
-filetype=asm < %s -no-dwarf-gnu-pub-sections | FileCheck
%s --check-prefix=DISABLED<br>
+; RUN: llc -mtriple=x86_64-pc-linux-gnu -debugger-tune=gdb
-filetype=asm < %s | FileCheck %s<br>
+<br>
+; DISABLED-NOT: {{.debug_gnu_pubnames|.debug_gnu_pubtypes}}<br>
+; CHECK-DAG: .section .debug_gnu_pubnames<br>
+; CHECK-DAG: .section .debug_gnu_pubtypes<br>
+<br>
+%struct.bar = type { %"struct.ns::foo" }<br>
+%"struct.ns::foo" = type { i8 }<br>
+<br>
+@b = global %struct.bar zeroinitializer, align 1, !dbg !0<br>
+<br>
+!<a
href="https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.dbg.cu&data=02%7C01%7C%7Ce807747c01a941a740d008d588307cfa%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636564664186820313&sdata=mvINKlfElV%2FOs5af4NhhZQhrn0uvO53zwdiaoqLGwPg%3D&reserved=0"
originalsrc="http://llvm.dbg.cu"
shash="E0jQLUOeuw3TChXjwlAtJ7izYd9uAionRZXCDSAToFuGbZKIpWWf2/3ZLjIyMTFMyt11BECzR7UTl5zdiwwK4QKFpb9Y29bh7+LkKwoJ+9EkP88A/DS6U5R/iBunTFZe+AoNZU+Ce4YDFDfF6rwAgm9J7cjNZffeRgPm04gXpnc="
rel="noreferrer" target="_blank" moz-do-not-send="true">llvm.dbg.cu</a>
= !{!2}<br>
+!llvm.module.flags = !{!11, !12}<br>
+!llvm.ident = !{!13}<br>
+<br>
+!0 = !DIGlobalVariableExpression(var: !1, expr:
!DIExpression())<br>
+!1 = distinct !DIGlobalVariable(name: "b", scope: !2, file:
!3, line: 8, type: !6, isLocal: false, isDefinition: true)<br>
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus,
file: !3, producer: "clang", isOptimized: false,
runtimeVersion: 0, emissionKind: FullDebug, enums: !4,
globals: !5, gnuPubnames: true)<br>
+!3 = !DIFile(filename: "type.cpp", directory: "/tmp/dbginfo")<br>
+!4 = !{}<br>
+!5 = !{!0}<br>
+!6 = distinct !DICompositeType(tag: DW_TAG_structure_type,
name: "bar", file: !3, line: 5, size: 8, elements: !7,
identifier: "_ZTS3bar")<br>
+!7 = !{!8}<br>
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "f", scope: !6,
file: !3, line: 6, baseType: !9, size: 8)<br>
+!9 = distinct !DICompositeType(tag: DW_TAG_structure_type,
name: "foo", scope: !10, file: !3, line: 2, size: 8, elements:
!4, identifier: "_ZTSN2ns3fooE")<br>
+!10 = !DINamespace(name: "ns", scope: null)<br>
+!11 = !{i32 2, !"Dwarf Version", i32 4}<br>
+!12 = !{i32 2, !"Debug Info Version", i32 3}<br>
+!13 = !{!"clang"}<br>
+<br>
Index: lib/CodeGen/AsmPrinter/DwarfDebug.h<br>
===================================================================<br>
--- lib/CodeGen/AsmPrinter/DwarfDebug.h<br>
+++ lib/CodeGen/AsmPrinter/DwarfDebug.h<br>
@@ -258,6 +258,9 @@<br>
/// Use inlined strings.<br>
bool UseInlineStrings = false;<br>
<br>
+ /// Emit GNU pub sections.<br>
+ bool UseGnuPubSections = true;<br>
+<br>
/// DWARF5 Experimental Options<br>
/// @{<br>
bool HasDwarfAccelTables;<br>
@@ -501,6 +504,9 @@<br>
/// Returns whether to use inline strings.<br>
bool useInlineStrings() const { return UseInlineStrings; }<br>
<br>
+ /// Returns whether GNU oub sections should be emitted.<br>
+ bool useGnuPubSections() const { return UseGnuPubSections;
}<br>
+<br>
// Experimental DWARF5 features.<br>
<br>
/// Returns whether or not to emit tables that dwarf
consumers can<br>
Index: lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
===================================================================<br>
--- lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
+++ lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
@@ -123,6 +123,11 @@<br>
clEnumVal(Disable, "Disabled")),<br>
cl::init(Default));<br>
<br>
+static cl::opt<bool><br>
+ NoDwarfGnuPubSections("no-dwarf-gnu-pub-sections",
cl::Hidden,<br>
+ cl::desc("Disable emission of GNU
pub sections."),<br>
+ cl::init(false));<br>
+<br>
enum LinkageNameOption {<br>
DefaultLinkageNames,<br>
AllLinkageNames,<br>
@@ -310,6 +315,8 @@<br>
// Use dwarf 4 by default if nothing is requested.<br>
DwarfVersion = DwarfVersion ? DwarfVersion :
dwarf::DWARF_VERSION;<br>
<br>
+ UseGnuPubSections = !NoDwarfGnuPubSections;<br>
+<br>
// Work around a GDB bug. GDB doesn't support the standard
opcode;<br>
// SCE doesn't support GNU's; LLDB prefers the standard
opcode, which<br>
// is defined as of DWARF 3.<br>
Index: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br>
===================================================================<br>
--- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br>
+++ lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br>
@@ -846,6 +846,9 @@<br>
}<br>
<br>
bool DwarfCompileUnit::hasDwarfPubSections() const {<br>
+ if (!DD->useGnuPubSections())<br>
+ return false;<br>
+<br>
// Opting in to GNU Pubnames/types overrides the default to
ensure these are<br>
// generated for things like Gold's gdb_index generation.<br>
if (CUNode->getGnuPubnames())<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank"
moz-do-not-send="true">llvm-commits@lists.llvm.org</a><br>
<a
href="https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fllvm-commits&data=02%7C01%7C%7Ce807747c01a941a740d008d588307cfa%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636564664186820313&sdata=ZxN57GAvnidN0SdqWHnarsekldPVyOFUKgvY74tzc68%3D&reserved=0"
originalsrc="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits"
shash="rdXW7RG5jfxY/4i2wIhq5ckBZ/ig3qx8Ej+XTmoGIv/djcaEdZNsNDTJ/0Nvka4JrCkCY69E2+MC5P9l5ZgSdLTwWs+fYJ4PA7XIgnc2FodZFhQaeS1AL6zEvSnI6Fyra3W4xPiYANNPJo+g0G1JgDiiHZyT/pHbtN/QpaIpMj4="
rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote>
</div>
</blockquote>
<br>
</body>
</html>