[LTO] Make detection of WPD remark enablement more robust
authorTeresa Johnson <tejohnson@google.com>
Tue, 18 Sep 2018 13:42:24 +0000 (13:42 +0000)
committerTeresa Johnson <tejohnson@google.com>
Tue, 18 Sep 2018 13:42:24 +0000 (13:42 +0000)
commit5e1c0e7610406df5300be63e4b4cd5a05cc0a2a2
tree4c8dd5ac321d52c6da5a3f59fcde5860114cd31f
parente7e14f464c98d150597a49a748bedde871917aa8
[LTO] Make detection of WPD remark enablement more robust

Summary:
Currently only the first function in the module is checked to
see if it has remarks enabled. If that first function is a declaration,
remarks will be incorrectly skipped. Change to look for the first
non-empty function.

Reviewers: pcc

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

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

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