[llvm-commits] CVS: llvm/tools/llvm-prof/llvm-prof.cpp
Chris Lattner
sabre at nondot.org
Sun May 6 16:46:45 PDT 2007
Changes in directory llvm/tools/llvm-prof:
llvm-prof.cpp updated: 1.33 -> 1.34
---
Log message:
use the new MemoryBuffer interfaces to simplify error reporting in clients.
---
Diffs of the changes: (+4 -6)
llvm-prof.cpp | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
Index: llvm/tools/llvm-prof/llvm-prof.cpp
diff -u llvm/tools/llvm-prof/llvm-prof.cpp:1.33 llvm/tools/llvm-prof/llvm-prof.cpp:1.34
--- llvm/tools/llvm-prof/llvm-prof.cpp:1.33 Sun May 6 04:29:57 2007
+++ llvm/tools/llvm-prof/llvm-prof.cpp Sun May 6 18:45:49 2007
@@ -118,13 +118,11 @@
// Read in the bytecode file...
std::string ErrorMessage;
Module *M;
- MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(&BytecodeFile[0],
- BytecodeFile.size());
- if (Buffer == 0)
- ErrorMessage = "Error reading file '" + BytecodeFile + "'";
- else
+ if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(BytecodeFile,
+ &ErrorMessage)) {
M = ParseBitcodeFile(Buffer, &ErrorMessage);
- delete Buffer;
+ delete Buffer;
+ }
if (M == 0) {
std::cerr << argv[0] << ": " << BytecodeFile << ": "
<< ErrorMessage << "\n";
More information about the llvm-commits
mailing list