summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-link/llvm-link.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-12-01 19:50:54 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-12-01 19:50:54 +0000
commit0e309fe860afa93bcb25685cac8a97b1316fa0a8 (patch)
tree512b6343a81006827c49f423c2953f178c71dc15 /llvm/tools/llvm-link/llvm-link.cpp
parent9cb01aa30a42c78248fea0a5c7335292718706b2 (diff)
downloadbcm5719-llvm-0e309fe860afa93bcb25685cac8a97b1316fa0a8.tar.gz
bcm5719-llvm-0e309fe860afa93bcb25685cac8a97b1316fa0a8.zip
Use references now that it is natural to do so.
The linker never takes ownership of a module or changes which module it is refering to, making it natural to use references. llvm-svn: 254449
Diffstat (limited to 'llvm/tools/llvm-link/llvm-link.cpp')
-rw-r--r--llvm/tools/llvm-link/llvm-link.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/llvm-link/llvm-link.cpp b/llvm/tools/llvm-link/llvm-link.cpp
index 984dfdcf70e..2b63649cec2 100644
--- a/llvm/tools/llvm-link/llvm-link.cpp
+++ b/llvm/tools/llvm-link/llvm-link.cpp
@@ -198,7 +198,7 @@ static bool importFunctions(const char *argv0, LLVMContext &Context,
}
// Link in the specified function.
- if (L.linkInModule(M.get(), Linker::Flags::None, Index.get(), F))
+ if (L.linkInModule(*M, Linker::Flags::None, Index.get(), F))
return false;
}
return true;
@@ -238,7 +238,7 @@ static bool linkFiles(const char *argv0, LLVMContext &Context, Linker &L,
if (Verbose)
errs() << "Linking in '" << File << "'\n";
- if (L.linkInModule(M.get(), ApplicableFlags, Index.get()))
+ if (L.linkInModule(*M, ApplicableFlags, Index.get()))
return false;
// All linker flags apply to linking of subsequent files.
ApplicableFlags = Flags;
@@ -266,7 +266,7 @@ int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv, "llvm linker\n");
auto Composite = make_unique<Module>("llvm-link", Context);
- Linker L(Composite.get(), diagnosticHandler);
+ Linker L(*Composite, diagnosticHandler);
unsigned Flags = Linker::Flags::None;
if (Internalize)
OpenPOWER on IntegriCloud