mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-09 05:13:01 +00:00
Implement Linker::LinkModules with Linker::linkInModule.
Flipping which one is the implementation will let us optimize linkInModule. llvm-svn: 181102
This commit is contained in:
parent
02f1d2a259
commit
f41d17e3f1
@ -1287,7 +1287,13 @@ Linker::~Linker() {
|
||||
}
|
||||
|
||||
bool Linker::linkInModule(Module *Src, unsigned Mode, std::string *ErrorMsg) {
|
||||
return LinkModules(Composite, Src, Linker::DestroySource, ErrorMsg);
|
||||
ModuleLinker TheLinker(Composite, Src, Mode);
|
||||
if (TheLinker.run()) {
|
||||
if (ErrorMsg)
|
||||
*ErrorMsg = TheLinker.ErrorMsg;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
@ -1301,13 +1307,8 @@ bool Linker::linkInModule(Module *Src, unsigned Mode, std::string *ErrorMsg) {
|
||||
/// and shouldn't be relied on to be consistent.
|
||||
bool Linker::LinkModules(Module *Dest, Module *Src, unsigned Mode,
|
||||
std::string *ErrorMsg) {
|
||||
ModuleLinker TheLinker(Dest, Src, Mode);
|
||||
if (TheLinker.run()) {
|
||||
if (ErrorMsg) *ErrorMsg = TheLinker.ErrorMsg;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
Linker L(Dest);
|
||||
return L.linkInModule(Src, Mode, ErrorMsg);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Loading…
Reference in New Issue
Block a user