Builder.CreateRet(ConstantPointerNull::get(Type::getInt8PtrTy(Ctx)));
Module *LinkedModule = new Module("MyModuleLinked", Ctx);
- Linker::LinkModules(LinkedModule, M.get());
+ Linker::linkModules(*LinkedModule, *M);
// Delete the original module.
M.reset();
TEST_F(LinkModuleTest, EmptyModule) {
std::unique_ptr<Module> InternalM(getInternal(Ctx));
std::unique_ptr<Module> EmptyM(new Module("EmptyModule1", Ctx));
- Linker::LinkModules(EmptyM.get(), InternalM.get());
+ Linker::linkModules(*EmptyM, *InternalM);
}
TEST_F(LinkModuleTest, EmptyModule2) {
std::unique_ptr<Module> InternalM(getInternal(Ctx));
std::unique_ptr<Module> EmptyM(new Module("EmptyModule1", Ctx));
- Linker::LinkModules(InternalM.get(), EmptyM.get());
+ Linker::linkModules(*InternalM, *EmptyM);
}
TEST_F(LinkModuleTest, TypeMerge) {
"@t2 = weak global %t zeroinitializer\n";
std::unique_ptr<Module> M2 = parseAssemblyString(M2Str, Err, C);
- Linker::LinkModules(M1.get(), M2.get(), [](const llvm::DiagnosticInfo &){});
+ Linker::linkModules(*M1, *M2, [](const llvm::DiagnosticInfo &) {});
EXPECT_EQ(M1->getNamedGlobal("t1")->getType(),
M1->getNamedGlobal("t2")->getType());
// Link into destination module.
auto Dst = llvm::make_unique<Module>("Linked", C);
ASSERT_TRUE(Dst.get());
- Linker::LinkModules(Dst.get(), Src.get(),
- [](const llvm::DiagnosticInfo &) {});
+ Linker::linkModules(*Dst, *Src, [](const llvm::DiagnosticInfo &) {});
// Check that distinct metadata was moved, not cloned. Even !4, the uniqued
// node, should effectively be moved, since its only operand hasn't changed.