diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-01-15 19:00:20 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-01-15 19:00:20 +0000 |
commit | 257a35368ff898d9f6f61ca86fa8ca5cc942385c (patch) | |
tree | 0baac849283f62ce74bb5c3ceac29bf25212d4d1 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | d4a0d188996d9bd0293b80826bc6fbc2a34d5d5b (diff) | |
download | bcm5719-llvm-257a35368ff898d9f6f61ca86fa8ca5cc942385c.tar.gz bcm5719-llvm-257a35368ff898d9f6f61ca86fa8ca5cc942385c.zip |
Bring back "Assert that we have all use/users in the getters."
This reverts commit r257751, bringing back r256105.
The problem the assert found was fixed in r257915.
Original commit message:
Assert that we have all use/users in the getters.
An error that is pretty easy to make is to use the lazy bitcode reader
and then do something like
if (V.use_empty())
The problem is that uses in unmaterialized functions are not accounted
for.
This patch adds asserts that all uses are known.
llvm-svn: 257920
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index a76bb23e952..2ad4b32e315 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -3022,7 +3022,7 @@ std::error_code BitcodeReader::parseUseLists() { V = ValueList[ID]; unsigned NumUses = 0; SmallDenseMap<const Use *, unsigned, 16> Order; - for (const Use &U : V->uses()) { + for (const Use &U : V->materialized_uses()) { if (++NumUses > Record.size()) break; Order[&U] = Record[NumUses - 1]; @@ -5267,7 +5267,8 @@ std::error_code BitcodeReader::materialize(GlobalValue *GV) { // Upgrade any old intrinsic calls in the function. for (auto &I : UpgradedIntrinsics) { - for (auto UI = I.first->user_begin(), UE = I.first->user_end(); UI != UE;) { + for (auto UI = I.first->materialized_user_begin(), UE = I.first->user_end(); + UI != UE;) { User *U = *UI; ++UI; if (CallInst *CI = dyn_cast<CallInst>(U)) |