summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-12-19 20:03:23 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-12-19 20:03:23 +0000
commite01e363fd9c5a93fe0a584a47a00703ae18090f4 (patch)
treec6bbd3bb4b1db671119ef34cb58afd2aa4f7d972 /llvm/lib/IR/Module.cpp
parent0334a047df7a1b9592221ac345e6c0663e56891d (diff)
downloadbcm5719-llvm-e01e363fd9c5a93fe0a584a47a00703ae18090f4.tar.gz
bcm5719-llvm-e01e363fd9c5a93fe0a584a47a00703ae18090f4.zip
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: 256105
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
-rw-r--r--llvm/lib/IR/Module.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index 0685c1a206d..ac578d6dba0 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/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() {
OpenPOWER on IntegriCloud