diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-19 20:03:23 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-19 20:03:23 +0000 |
commit | fdb838f3f8a8b6896bbbd5285555874eb3b748eb (patch) | |
tree | bb327efea5430802f5c35627328bdffe7a062dd1 /lib/IR/Module.cpp | |
parent | 25b4ccf2a65d754b09169602e88e12637d7068b7 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256105 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/Module.cpp')
-rw-r--r-- | lib/IR/Module.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/IR/Module.cpp b/lib/IR/Module.cpp index 0685c1a206d..ac578d6dba0 100644 --- a/lib/IR/Module.cpp +++ b/lib/IR/Module.cpp @@ -394,10 +394,8 @@ std::error_code Module::materialize(GlobalValue *GV) { std::error_code Module::materializeAll() { if (!Materializer) return std::error_code(); - if (std::error_code EC = Materializer->materializeModule()) - return EC; - Materializer.reset(); - return std::error_code(); + std::unique_ptr<GVMaterializer> M = std::move(Materializer); + return M->materializeModule(); } std::error_code Module::materializeMetadata() { |