<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Thanks, I already reverted it. It looks like I also broke the swift compiler, so I should be able to get a reproducer from there, too.<div class=""><br class=""></div><div class="">-- adrian<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 26, 2018, at 1:59 PM, Reid Kleckner <<a href="mailto:rnk@google.com" class="">rnk@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">This appears to be causing assertion failures in the Chromium build:<br class=""><div class=""><a href="https://ci.chromium.org/buildbot/chromium.clang/ToTLinux/2328" class="">https://ci.chromium.org/buildbot/chromium.clang/ToTLinux/2328</a><br class=""></div><div class=""><br class=""></div><div class="">The LLVM revision window is:</div><div class="">good: 330945</div><div class="">bad: 330975</div><div class=""><br class=""></div><div class="">I'll prepare a revert and get a repro.</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Thu, Apr 26, 2018 at 11:20 AM Adrian Prantl via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: adrian<br class="">
Date: Thu Apr 26 11:17:04 2018<br class="">
New Revision: 330970<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=330970&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=330970&view=rev</a><br class="">
Log:<br class="">
Fix a bug that prevents global variables from having a DW_OP_deref.<br class="">
<br class="">
For local variables the first DW_OP_deref is consumed by turning the<br class="">
location kind into a memeory location, but that only makes sense for<br class="">
values that are in a register to begin with, which cannot happen for<br class="">
global variables that are attached to a symbol.<br class="">
<br class="">
<a href="rdar://problem/39741860" class="">rdar://problem/39741860</a><br class="">
<br class="">
Added:<br class="">
llvm/trunk/test/DebugInfo/X86/global-expression.ll<br class="">
Modified:<br class="">
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br class="">
<br class="">
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=330970&r1=330969&r2=330970&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=330970&r1=330969&r2=330970&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)<br class="">
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Thu Apr 26 11:17:04 2018<br class="">
@@ -230,8 +230,9 @@ DIE *DwarfCompileUnit::getOrCreateGlobal<br class="">
addOpAddress(*Loc, Sym);<br class="">
}<br class="">
}<br class="">
- if (Expr)<br class="">
- DwarfExpr->addExpression(Expr);<br class="">
+ // Global variables attached to symbols are memory locations.<br class="">
+ DwarfExpr->setMemoryLocationKind();<br class="">
+ DwarfExpr->addExpression(Expr);<br class="">
}<br class="">
if (Loc)<br class="">
addBlock(*VariableDIE, dwarf::DW_AT_location, DwarfExpr->finalize());<br class="">
<br class="">
Added: llvm/trunk/test/DebugInfo/X86/global-expression.ll<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/global-expression.ll?rev=330970&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/global-expression.ll?rev=330970&view=auto</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/test/DebugInfo/X86/global-expression.ll (added)<br class="">
+++ llvm/trunk/test/DebugInfo/X86/global-expression.ll Thu Apr 26 11:17:04 2018<br class="">
@@ -0,0 +1,38 @@<br class="">
+; RUN: llc -mtriple=x86_64-apple-darwin %s -o - -filetype=obj | \<br class="">
+; RUN: llvm-dwarfdump --name i --name indirect - | FileCheck %s<br class="">
+;<br class="">
+; This is a hand-crafted testcase generated from:<br class="">
+; int i = 23;<br class="">
+; int *indirect = &i;<br class="">
+<br class="">
+; CHECK: DW_TAG_variable<br class="">
+; CHECK: DW_AT_name ("i")<br class="">
+; CHECK: DW_AT_location (DW_OP_addr 0x8, DW_OP_deref)<br class="">
+; CHECK: DW_TAG_variable<br class="">
+; CHECK: DW_AT_name ("indirect")<br class="">
+; CHECK: DW_AT_location (DW_OP_addr 0x8)<br class="">
+<br class="">
+source_filename = "global-deref.c"<br class="">
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"<br class="">
+target triple = "x86_64-apple-macosx10.13.0"<br class="">
+<br class="">
+@i = global i32 23, align 4<br class="">
+@indirect = global i32* @i, align 8, !dbg !6, !dbg !0<br class="">
+<br class="">
+!<a href="http://llvm.dbg.cu/" rel="noreferrer" target="_blank" class="">llvm.dbg.cu</a> = !{!2}<br class="">
+!llvm.module.flags = !{!10, !11, !12, !13}<br class="">
+<br class="">
+!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression(DW_OP_deref))<br class="">
+!1 = distinct !DIGlobalVariable(name: "i", scope: !2, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)<br class="">
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)<br class="">
+!3 = !DIFile(filename: "global-deref.c", directory: "/")<br class="">
+!4 = !{}<br class="">
+!5 = !{!0, !6}<br class="">
+!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())<br class="">
+!7 = distinct !DIGlobalVariable(name: "indirect", scope: !2, file: !3, line: 2, type: !8, isLocal: false, isDefinition: true)<br class="">
+!8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64)<br class="">
+!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)<br class="">
+!10 = !{i32 2, !"Dwarf Version", i32 4}<br class="">
+!11 = !{i32 2, !"Debug Info Version", i32 3}<br class="">
+!12 = !{i32 1, !"wchar_size", i32 4}<br class="">
+!13 = !{i32 7, !"PIC Level", i32 2}<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="">
</blockquote></div>
</div></blockquote></div><br class=""></div></body></html>