diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-01 19:50:54 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-01 19:50:54 +0000 |
commit | 0e309fe860afa93bcb25685cac8a97b1316fa0a8 (patch) | |
tree | 512b6343a81006827c49f423c2953f178c71dc15 /llvm/tools/gold/gold-plugin.cpp | |
parent | 9cb01aa30a42c78248fea0a5c7335292718706b2 (diff) | |
download | bcm5719-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/gold/gold-plugin.cpp')
-rw-r--r-- | llvm/tools/gold/gold-plugin.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index b8318be27ce..1bd2f8afb29 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -938,7 +938,7 @@ static ld_plugin_status allSymbolsReadHook(raw_fd_ostream *ApiFile) { } std::unique_ptr<Module> Combined(new Module("ld-temp.o", Context)); - Linker L(Combined.get()); + Linker L(*Combined); std::string DefaultTriple = sys::getDefaultTargetTriple(); @@ -956,7 +956,7 @@ static ld_plugin_status allSymbolsReadHook(raw_fd_ostream *ApiFile) { M->setTargetTriple(DefaultTriple); } - if (L.linkInModule(M.get())) + if (L.linkInModule(*M)) message(LDPL_FATAL, "Failed to link module"); if (release_input_file(F.handle) != LDPS_OK) message(LDPL_FATAL, "Failed to release file information"); @@ -986,7 +986,7 @@ static ld_plugin_status allSymbolsReadHook(raw_fd_ostream *ApiFile) { path = output_name; else path = output_name + ".bc"; - saveBCFile(path, *L.getModule()); + saveBCFile(path, *Combined); if (options::TheOutputType == options::OT_BC_ONLY) return LDPS_OK; } |