forked from OSchip/llvm-project
[ELF] - Improve call graph pasing error reporting.
This adds a file name to the error message, adds a missing test case and refactors code a bit. llvm-svn: 336651
This commit is contained in:
parent
20b92c4d0d
commit
bc6702a424
|
@ -631,11 +631,9 @@ static void readCallGraph(MemoryBufferRef MB) {
|
|||
for (StringRef L : args::getLines(MB)) {
|
||||
SmallVector<StringRef, 3> Fields;
|
||||
L.split(Fields, ' ');
|
||||
if (Fields.size() != 3)
|
||||
fatal("parse error");
|
||||
uint64_t Count;
|
||||
if (!to_integer(Fields[2], Count))
|
||||
fatal("parse error");
|
||||
if (Fields.size() != 3 || !to_integer(Fields[2], Count))
|
||||
fatal(MB.getBufferIdentifier() + ": parse error");
|
||||
const Symbol *FromSym = SymbolNameToSymbol.lookup(Fields[0]);
|
||||
const Symbol *ToSym = SymbolNameToSymbol.lookup(Fields[1]);
|
||||
if (Config->WarnSymbolOrdering) {
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
# REQUIRES: x86
|
||||
|
||||
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
|
||||
|
||||
# RUN: echo "A B C 100" > %t.call_graph
|
||||
# RUN: not ld.lld %t --call-graph-ordering-file \
|
||||
# RUN: %t.call_graph -o /dev/null 2>&1 | FileCheck %s
|
||||
|
||||
# CHECK: {{.*}}.call_graph: parse error
|
||||
|
||||
# RUN: echo "A B C" > %t.call_graph
|
||||
# RUN: not ld.lld %t --call-graph-ordering-file \
|
||||
# RUN: %t.call_graph -o /dev/null 2>&1 | FileCheck %s
|
Loading…
Reference in New Issue