[ThinLTO] Fix printing of WPD remarks
authorTeresa Johnson <tejohnson@google.com>
Tue, 14 Aug 2018 03:00:16 +0000 (03:00 +0000)
committerTeresa Johnson <tejohnson@google.com>
Tue, 14 Aug 2018 03:00:16 +0000 (03:00 +0000)
commitb0a1d3bdf1d0124c555231a518cb6da769cceb05
treea54475cc4e00a5f39f97d12e10ce714ff4129ebe
parentb7b342e2805a7d674ead0e5bf9ab7307e2ec12b3
[ThinLTO] Fix printing of WPD remarks

Summary:
When WPD is performed in a ThinLTO backend, the function may be created
if it isn't already in that module. Module::getOrInsertFunction may
add a bitcast, in which case the returned Constant is not a Function and
doesn't have a name. Invoke stripPointerCasts() on the returned value
where we access its name.

Reviewers: pcc

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits

Differential Revision: https://reviews.llvm.org/D49959

llvm-svn: 339640
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
llvm/test/ThinLTO/X86/cfi-devirt.ll