[PATCH] D56767: [AsmPrinter] Collapse .loc 0 0 directives

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 16 08:15:10 PST 2019


aprantl added a comment.

Thanks for the patch! The testcase looks like it would bitrot very easily. I would recommend first manually reducing the IR as much as possible and then making a MIR testcase out of it to become independent from future ISEL changes.



================
Comment at: test/DebugInfo/X86/debug-loc-0.ll:74
+
+!0 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !1, producer: "Swift version 4.2.1-dev effective-3.4.1 (LLVM 4ba03d9389, Clang 78aa734eee, Swift f4134ebef6)", isOptimized: false, flags: "-target x86_64-apple-macosx10.9 -module-cache-path /Users/jonas/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./swift-test-results/x86_64-apple-macosx10.9/clang-module-cache -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -swift-version 3 -g -I /Users/jonas/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/test-macosx-x86_64/DebugInfo/Output/struct_resilience.swift.tmp -emit-ir -enable-resilience /Users/jonas/swift/swift/test/DebugInfo/struct_resilience.swift -o /tmp/41.ll -resource-dir /Users/jonas/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/lib/swift", runtimeVersion: 4, emissionKind: FullDebug, enums: !2, imports: !3)
+!1 = !DIFile(filename: "/Users/jonas/swift/swift/test/DebugInfo/struct_resilience.swift", directory: "/Users/jonas/swift")
----------------
Looks like there is a lot of metadata that is not really relevant to the test. I think we should be able to strip everything that is not a DIFile/DIScope/DICompileUnit from the metadata and !llvm.* named mdnodes.


================
Comment at: test/DebugInfo/X86/debug-loc-0.ll:114
+!39 = !DILocation(line: 25, column: 3, scope: !32)
+!40 = !DILocation(line: 37, column: 1, scope: !32)
----------------
We probably don't need more than one nonzero DILocation?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56767/new/

https://reviews.llvm.org/D56767





More information about the llvm-commits mailing list