[PATCH] D74507: [llvm-objdump] Print method name from debug info in disassembly output.
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 13 16:57:55 PST 2020
dblaikie added inline comments.
================
Comment at: llvm/test/tools/llvm-objdump/X86/source-interleave-function-from-debug.test:4
+
+; RUN: llc < %s -o %t.o -filetype=obj -mtriple=x86_64-pc-linux
+; RUN: llvm-strip %t.o -N foo -N bar -o %t-stripped.o
----------------
Clearly there's prior art here, but testing objdump with llc seems a bit heavyweight/circular (no doubt some llc tests use llvm-objdump to verify their result) - I'd expect this to use raw assembly + llvm-mc at most.
not a requirement for change, just a thought
================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:652
+ LineInfo.FunctionName != OldLineInfo.FunctionName)
+ OS << Delimiter << LineInfo.FunctionName << "():\n";
+ if (LineInfo.FileName != DILineInfo::BadString && LineInfo.Line != 0)
----------------
Is the intent to print the demangled name? The test doesn't verify demangling is happening (since it uses unmangled names to begin with) & it doesn't look like it is happening, given SymbolizerOpts.Demangle = false; on line 569
================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:660
+ StringRef Delimiter) {
+ if (LineInfo.FileName != DILineInfo::BadString && LineInfo.Line != 0) {
if (SourceCache.find(LineInfo.FileName) == SourceCache.end())
----------------
Might be worth flipping this and using an early return, so the rest of the function can be a little less indented.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74507/new/
https://reviews.llvm.org/D74507
More information about the llvm-commits
mailing list