[llvm] r315088 - Revert "[dsymutil] Emit valid debug locations when no symbol flags are set"

Francis Ricci via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 6 11:19:52 PDT 2017


Author: fjricci
Date: Fri Oct  6 11:19:52 2017
New Revision: 315088

URL: http://llvm.org/viewvc/llvm-project?rev=315088&view=rev
Log:
Revert "[dsymutil] Emit valid debug locations when no symbol flags are set"

This reverts commit r315082, which fails on non-darwin buildbots.

Removed:
    llvm/trunk/test/tools/dsymutil/Inputs/swift-dwarf-loc.ll
    llvm/trunk/test/tools/dsymutil/X86/swift-dwarf-loc.test
Modified:
    llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp

Removed: llvm/trunk/test/tools/dsymutil/Inputs/swift-dwarf-loc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/Inputs/swift-dwarf-loc.ll?rev=315087&view=auto
==============================================================================
--- llvm/trunk/test/tools/dsymutil/Inputs/swift-dwarf-loc.ll (original)
+++ llvm/trunk/test/tools/dsymutil/Inputs/swift-dwarf-loc.ll (removed)
@@ -1,25 +0,0 @@
-; ModuleID = '-'
-source_filename = "-"
-target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-apple-macosx10.12"
-
-%TSi = type <{ i64 }>
-
- at _var = hidden global %TSi zeroinitializer, align 8, !dbg !0
-
-!llvm.dbg.cu = !{!8}
-!llvm.module.flags = !{!11, !12}
-
-!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
-!1 = distinct !DIGlobalVariable(name: "x", linkageName: "_var", scope: !2, file: !3, line: 1, type: !4, isLocal: false, isDefinition: true)
-!2 = !DIModule(scope: null, name: "main")
-!3 = !DIFile(filename: "<stdin>", directory: "")
-!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "Int", scope: !6, file: !5, size: 64, elements: !7, runtimeLang: DW_LANG_Swift, identifier: "_T0SiD")
-!5 = !DIFile(filename: "foo", directory: "/tmp")
-!6 = !DIModule(scope: null, name: "foo", includePath: "")
-!7 = !{}
-!8 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !9, producer: "swiftc", isOptimized: false, flags: "", runtimeVersion: 4, emissionKind: FullDebug, enums: !7, globals: !10, imports: null)
-!9 = !DIFile(filename: "/tmp", directory: "")
-!10 = !{!0}
-!11 = !{i32 2, !"Dwarf Version", i32 4}
-!12 = !{i32 2, !"Debug Info Version", i32 3}

Removed: llvm/trunk/test/tools/dsymutil/X86/swift-dwarf-loc.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/X86/swift-dwarf-loc.test?rev=315087&view=auto
==============================================================================
--- llvm/trunk/test/tools/dsymutil/X86/swift-dwarf-loc.test (original)
+++ llvm/trunk/test/tools/dsymutil/X86/swift-dwarf-loc.test (removed)
@@ -1,9 +0,0 @@
-RUN: llc -filetype=obj %p/../Inputs/swift-dwarf-loc.ll -mtriple x86_64-apple-darwin -o %T/swift-dwarf-loc.o
-RUN: ld -dylib %T/swift-dwarf-loc.o -arch x86_64 -lSystem -macosx_version_min 10.9.0 -o %T/swift-dwarf-loc
-RUN: llvm-dsymutil %T/swift-dwarf-loc -no-output -verbose | FileCheck %s
-
-This test checks that dsymutil generates a valid dwarf location for a symbol with no flags set.
-
-CHECK: __var,
-CHECK-NOT: __var,{{.*}}binAddr: 0x0000000000000000
-CHECK-NOT: __var{{.*}} => 0000000000000000

Modified: llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp?rev=315088&r1=315087&r2=315088&view=diff
==============================================================================
--- llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp (original)
+++ llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp Fri Oct  6 11:19:52 2017
@@ -482,9 +482,7 @@ void MachODebugMapParser::loadMainBinary
     // are the only ones that need to be queried because the address
     // of common data won't be described in the debug map. All other
     // addresses should be fetched for the debug map.
-    uint8_t SymType =
-        MainBinary.getSymbolTableEntry(Sym.getRawDataRefImpl()).n_type;
-    if (!(SymType & (MachO::N_EXT | MachO::N_PEXT)))
+    if (!(Sym.getFlags() & SymbolRef::SF_Global))
       continue;
     Expected<section_iterator> SectionOrErr = Sym.getSection();
     if (!SectionOrErr) {




More information about the llvm-commits mailing list