[llvm-commits] CVS: llvm/tools/llc/llc.cpp
Chris Lattner
sabre at nondot.org
Sat May 5 22:47:54 PDT 2007
Changes in directory llvm/tools/llc:
llc.cpp updated: 1.146 -> 1.147
---
Log message:
use an auto_ptr to avoid an explicit delete
---
Diffs of the changes: (+5 -7)
llc.cpp | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
Index: llvm/tools/llc/llc.cpp
diff -u llvm/tools/llc/llc.cpp:1.146 llvm/tools/llc/llc.cpp:1.147
--- llvm/tools/llc/llc.cpp:1.146 Sat May 5 23:55:19 2007
+++ llvm/tools/llc/llc.cpp Sun May 6 00:47:36 2007
@@ -184,14 +184,12 @@
std::auto_ptr<Module> M;
if (Bitcode) {
- MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(&InputFilename[0],
- InputFilename.size());
- if (Buffer == 0)
- ErrorMessage = "Error reading file '" + InputFilename + "'";
+ std::auto_ptr<MemoryBuffer> Buffer(
+ MemoryBuffer::getFileOrSTDIN(&InputFilename[0], InputFilename.size()));
+ if (Buffer.get())
+ M.reset(ParseBitcodeFile(Buffer.get(), &ErrorMessage));
else
- M.reset(ParseBitcodeFile(Buffer, &ErrorMessage));
- delete Buffer;
-
+ ErrorMessage = "Error reading file '" + InputFilename + "'";
} else {
M.reset(ParseBytecodeFile(InputFilename,
Compressor::decompressToNewBuffer,
More information about the llvm-commits
mailing list