[CodeGen] Insert TargetLibraryInfoWrapperPass before anything else.
authorMarcin Koscielnicki <koriakin@0x04.net>
Tue, 22 Nov 2016 20:03:35 +0000 (20:03 +0000)
committerMarcin Koscielnicki <koriakin@0x04.net>
Tue, 22 Nov 2016 20:03:35 +0000 (20:03 +0000)
commit9a063e7c02328968b69ee40981175e52f50bde79
treeee0ee9d1dc29bc871f4ce5b89d403809fa8ae34f
parent3028189ee393a8cb8a6e5c96cb5e9c580b338759
[CodeGen] Insert TargetLibraryInfoWrapperPass before anything else.

Currently, TargetLibraryInfoWrapperPass is inserted by PMBuilder.
However, some passes are inserted manually before the PMBuilder
ones - if any of them happens to use TargetLibraryInfoWrapperPass,
it'll get a default-constructed one, with an unknown target triple.
This happens to InstrProfiling in D21736, breaking it.

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

llvm-svn: 287688
clang/lib/CodeGen/BackendUtil.cpp