From 65c0120193feebdd6e72f4acf9f15a0fdd1433c9 Mon Sep 17 00:00:00 2001 From: Michael Zolotukhin Date: Thu, 14 Jan 2016 09:02:45 +0000 Subject: Revert "Assert that we have all use/users in the getters." This reverts commit fdb838f3f8a8b6896bbbd5285555874eb3b748eb. llvm-svn: 257751 --- llvm/lib/IR/Module.cpp | 6 ++++-- llvm/lib/IR/Value.cpp | 10 ---------- llvm/lib/IR/Verifier.cpp | 4 +--- 3 files changed, 5 insertions(+), 15 deletions(-) (limited to 'llvm/lib/IR') diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp index ac578d6dba0..0685c1a206d 100644 --- a/llvm/lib/IR/Module.cpp +++ b/llvm/lib/IR/Module.cpp @@ -394,8 +394,10 @@ std::error_code Module::materialize(GlobalValue *GV) { std::error_code Module::materializeAll() { if (!Materializer) return std::error_code(); - std::unique_ptr M = std::move(Materializer); - return M->materializeModule(); + if (std::error_code EC = Materializer->materializeModule()) + return EC; + Materializer.reset(); + return std::error_code(); } std::error_code Module::materializeMetadata() { diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp index eb9deb6a07e..925f2058e55 100644 --- a/llvm/lib/IR/Value.cpp +++ b/llvm/lib/IR/Value.cpp @@ -314,16 +314,6 @@ void Value::takeName(Value *V) { } #ifndef NDEBUG -void Value::assertModuleIsMaterialized() const { - const GlobalValue *GV = dyn_cast(this); - if (!GV) - return; - const Module *M = GV->getParent(); - if (!M) - return; - assert(M->isMaterialized()); -} - static bool contains(SmallPtrSetImpl &Cache, ConstantExpr *Expr, Constant *C) { if (!Cache.insert(Expr).second) diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 9198b0e1fb5..c4519c48ab5 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -1901,9 +1901,7 @@ void Verifier::visitFunction(const Function &F) { // If this function is actually an intrinsic, verify that it is only used in // direct call/invokes, never having its "address taken". - // Only do this if the module is materialized, otherwise we don't have all the - // uses. - if (F.getIntrinsicID() && F.getParent()->isMaterialized()) { + if (F.getIntrinsicID()) { const User *U; if (F.hasAddressTaken(&U)) Assert(0, "Invalid user of intrinsic instruction!", U); -- cgit v1.2.3