Make it possible to use the linker without destroying the source module. This is...
[oota-llvm.git] / tools / bugpoint / BugDriver.cpp
index aa3e2906364315feb21b72522a4fbc62c40cfe44..677d17887f40cec78b255d35bdc892bd12e81d1d 100644 (file)
@@ -127,7 +127,8 @@ bool BugDriver::addSources(const std::vector<std::string> &Filenames) {
 
     outs() << "Linking in input file: '" << Filenames[i] << "'\n";
     std::string ErrorMessage;
-    if (Linker::LinkModules(Program, M.get(), &ErrorMessage)) {
+    if (Linker::LinkModules(Program, M.get(), Linker::DestroySource,
+                            &ErrorMessage)) {
       errs() << ToolName << ": error linking in '" << Filenames[i] << "': "
              << ErrorMessage << '\n';
       return true;