From 257a35368ff898d9f6f61ca86fa8ca5cc942385c Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 15 Jan 2016 19:00:20 +0000 Subject: 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 --- llvm/lib/IR/Module.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/IR/Module.cpp') 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 M = std::move(Materializer); + return M->materializeModule(); } std::error_code Module::materializeMetadata() { -- cgit v1.2.3