Fix SamplePGO segfault when debug info is missing.
authorDiego Novillo <dnovillo@google.com>
Tue, 27 Oct 2015 17:37:00 +0000 (17:37 +0000)
committerDiego Novillo <dnovillo@google.com>
Tue, 27 Oct 2015 17:37:00 +0000 (17:37 +0000)
commit76c9c0f9159bf809440d1f1caf9e422e0dd24ea7
treeb9ed6af50d9056edb9cc92ebe542df03b0edba3f
parent851a56a34f563f0031e786f0a2bcfec774087a6f
Fix SamplePGO segfault when debug info is missing.

When emitting a remark for a conditional branch annotation, the remark
uses the line location information of the conditional branch in the
message.  In some cases, that information is unavailable and the
optimization would segfaul. I'm still not sure whether this is a bug or
WAI, but the optimizer should not die because of this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251420 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/SampleProfile.cpp
test/Transforms/SampleProfile/Inputs/nolocinfo.prof [new file with mode: 0644]
test/Transforms/SampleProfile/nolocinfo.ll [new file with mode: 0644]