[llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.cpp

Chris Lattner sabre at nondot.org
Sun May 6 16:46:37 PDT 2007



Changes in directory llvm/tools/bugpoint:

BugDriver.cpp updated: 1.53 -> 1.54
---
Log message:

use the new MemoryBuffer interfaces to simplify error reporting in clients.


---
Diffs of the changes:  (+5 -4)

 BugDriver.cpp |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)


Index: llvm/tools/bugpoint/BugDriver.cpp
diff -u llvm/tools/bugpoint/BugDriver.cpp:1.53 llvm/tools/bugpoint/BugDriver.cpp:1.54
--- llvm/tools/bugpoint/BugDriver.cpp:1.53	Sun May  6 04:32:02 2007
+++ llvm/tools/bugpoint/BugDriver.cpp	Sun May  6 18:45:48 2007
@@ -72,18 +72,18 @@
 /// ParseInputFile - Given a bytecode or assembly input filename, parse and
 /// return it, or return null if not possible.
 ///
-Module *llvm::ParseInputFile(const std::string &InputFilename) {
-  std::auto_ptr<MemoryBuffer> Buffer(
-       MemoryBuffer::getFileOrSTDIN(&InputFilename[0], InputFilename.size()));
+Module *llvm::ParseInputFile(const std::string &Filename) {
+  std::auto_ptr<MemoryBuffer> Buffer(MemoryBuffer::getFileOrSTDIN(Filename));
   Module *Result = 0;
   if (Buffer.get())
     Result = ParseBitcodeFile(Buffer.get());
   
   ParseError Err;
-  if (!Result && !(Result = ParseAssemblyFile(InputFilename,&Err))) {
+  if (!Result && !(Result = ParseAssemblyFile(Filename, &Err))) {
     std::cerr << "bugpoint: " << Err.getMessage() << "\n"; 
     Result = 0;
   }
+  
   return Result;
 }
 
@@ -100,6 +100,7 @@
     // Load the first input file.
     Program = ParseInputFile(Filenames[0]);
     if (Program == 0) return true;
+    
     if (!run_as_child)
       std::cout << "Read input file      : '" << Filenames[0] << "'\n";
 






More information about the llvm-commits mailing list