[llvm-commits] CVS: llvm/tools/llvm-dis/llvm-dis.cpp
Chris Lattner
sabre at nondot.org
Sun May 6 16:46:43 PDT 2007
Changes in directory llvm/tools/llvm-dis:
llvm-dis.cpp updated: 1.61 -> 1.62
---
Log message:
use the new MemoryBuffer interfaces to simplify error reporting in clients.
---
Diffs of the changes: (+4 -7)
llvm-dis.cpp | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
Index: llvm/tools/llvm-dis/llvm-dis.cpp
diff -u llvm/tools/llvm-dis/llvm-dis.cpp:1.61 llvm/tools/llvm-dis/llvm-dis.cpp:1.62
--- llvm/tools/llvm-dis/llvm-dis.cpp:1.61 Sun May 6 04:29:57 2007
+++ llvm/tools/llvm-dis/llvm-dis.cpp Sun May 6 18:45:48 2007
@@ -54,14 +54,11 @@
std::auto_ptr<Module> M;
- MemoryBuffer *Buffer
- = MemoryBuffer::getFileOrSTDIN(&InputFilename[0], InputFilename.size());
-
- if (Buffer == 0)
- ErrorMessage = "Error reading file '" + InputFilename + "'";
- else
+ if (MemoryBuffer *Buffer
+ = MemoryBuffer::getFileOrSTDIN(InputFilename, &ErrorMessage)) {
M.reset(ParseBitcodeFile(Buffer, &ErrorMessage));
- delete Buffer;
+ delete Buffer;
+ }
if (M.get() == 0) {
cerr << argv[0] << ": ";
More information about the llvm-commits
mailing list