[ThinLTO] Add optional import message and statistics
authorTeresa Johnson <tejohnson@google.com>
Sun, 27 Mar 2016 15:27:30 +0000 (15:27 +0000)
committerTeresa Johnson <tejohnson@google.com>
Sun, 27 Mar 2016 15:27:30 +0000 (15:27 +0000)
commitd29478f70ed60a34e5737c4f48be638ef35f3c41
tree6acde4398a57f947b921fdcaef7d97fd02a7917f
parent9aae395fa809aa07dcceafc2552cca45205c43bd
[ThinLTO] Add optional import message and statistics

Summary:
Add a statistic to count the number of imported functions. Also, add a
new -print-imports option to emit a trace of imported functions, that
works even for an NDEBUG build.

Note that emitOptimizationRemark does not work for the above printing as
it expects a Function object and DebugLoc, neither of which we have
with summary-based importing.

This is part 2 of D18487, the first part was committed separately as
r264536.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

Differential Revision: http://reviews.llvm.org/D18487

llvm-svn: 264537
llvm/lib/Transforms/IPO/FunctionImport.cpp
llvm/test/Transforms/FunctionImport/funcimport.ll