If all linker input files are native object files then lto-bugpoint is not useful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53777 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/lto-bugpoint/lto-bugpoint.cpp b/tools/lto-bugpoint/lto-bugpoint.cpp
index 8633415..01adb57 100644
--- a/tools/lto-bugpoint/lto-bugpoint.cpp
+++ b/tools/lto-bugpoint/lto-bugpoint.cpp
@@ -47,16 +47,13 @@
 
     // Third argument is absolute path to the validation script. This
     // script is used to validate LTO error under investigation.
-    std::istream *ValidationScriptFile = new std::ifstream(argv[3], input_mode);
-    if (!ValidationScriptFile->good()) {
-      std::cerr << argv[0] << ": error opening " << argv[3] << "!\n";
-      delete LinkerArgsFile;
-      delete LinkerInputsFile;
-      return 1;
-    }
-
+    std::string ValidationScript = argv[3];
     LTOBugPoint bugFinder(*LinkerArgsFile, *LinkerInputsFile);
 
+    llvm::SmallVector<std::string, 4> TroubleMakers;
+    if (!bugFinder.findTroubleMakers(TroubleMakers, ValidationScript))
+      return 1;
+
     return 0;
   } catch (const std::string& msg) {
     std::cerr << argv[0] << ": " << msg << "\n";