UseListOrder: Fix blockaddress use-list order
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 1 Aug 2014 22:27:19 +0000 (22:27 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 1 Aug 2014 22:27:19 +0000 (22:27 +0000)
commit15262784434ada50aeb5f8474b880ce5d672fb0e
tree312520177e3afde5724eb9a9b8554f90f0c652bc
parent306030f8aa52ace8fd57a9b9aca06bedac3b32de
UseListOrder: Fix blockaddress use-list order

`parseBitcodeFile()` uses the generic `getLazyBitcodeFile()` function as
a helper.  Since `parseBitcodeFile()` isn't actually lazy -- it calls
`MaterializeAllPermanently()` -- bypass the unnecessary call to
`materializeForwardReferencedFunctions()` by extracting out a common
helper function.  This removes the last of the use-list churn caused by
blockaddresses.

This highlights that we can't reproduce use-list order of globals and
constants when parsing lazily -- but that's necessarily out of scope.
When we're parsing lazily, we never have all the functions in memory, so
the use-lists of globals (and constants that reference globals) are
always incomplete.

This is part of PR5680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214581 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Bitcode/Reader/BitcodeReader.cpp
test/Bitcode/blockaddress.ll
test/Bitcode/use-list-order.ll