From 6db85518665b19cdbb9a6ef342b0f6ffca9ce808 Mon Sep 17 00:00:00 2001 From: Peter Goodman Date: Sun, 21 Feb 2021 23:56:24 -0500 Subject: [PATCH] Tweak moving into modules to not die when the target function is non-empty (#490) --- lib/BC/Util.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/BC/Util.cpp b/lib/BC/Util.cpp index d3e64e921..052e3f230 100644 --- a/lib/BC/Util.cpp +++ b/lib/BC/Util.cpp @@ -1527,9 +1527,6 @@ void MoveFunctionIntoModule(llvm::Function *func, llvm::Module *dest_module) { CHECK_NE(existing_decl_in_dest_module, func); CHECK_EQ(existing_decl_in_dest_module->getFunctionType(), func->getFunctionType()); - CHECK(existing_decl_in_dest_module->isDeclaration()) - << "Function " << func->getName().str() - << " already exists in destination module."; existing_decl_in_dest_module->setName(llvm::Twine::createNull()); existing_decl_in_dest_module->setLinkage(llvm::GlobalValue::PrivateLinkage);