[PATCH] D21550: [lld] support --trace-symbol (alias -y) option

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 03:25:39 PDT 2016


ruiu added a comment.

Noticed that there's a better way to print out "definition of" messages.

First, just add `traceUndefined` member function to ObjectFile and print out "reference to" messages if a given string is a member of Config->TraceSymbol.

And then define `traceSymbol` member function to SymbolTable. That function should iterate over all strings in Config->TraceSymbol. For each string, it looks up a defined symbol, and if it is defined, it prints out a "definition of" message. SymbolTable has scan* functions, and they are good examples how to do it.

In this way, I think code for --trace-symbol would be separated nicely from the main code.


http://reviews.llvm.org/D21550





More information about the llvm-commits mailing list