llvm.org GIT mirror llvm / db9cbeb
use an auto_ptr to avoid an explicit delete git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36850 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
1 changed file(s) with 5 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
183183 std::auto_ptr M;
184184
185185 if (Bitcode) {
186 MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(&InputFilename[0],
187 InputFilename.size());
188 if (Buffer == 0)
186 std::auto_ptr Buffer(
187 MemoryBuffer::getFileOrSTDIN(&InputFilename[0], InputFilename.size()));
188 if (Buffer.get())
189 M.reset(ParseBitcodeFile(Buffer.get(), &ErrorMessage));
190 else
189191 ErrorMessage = "Error reading file '" + InputFilename + "'";
190 else
191 M.reset(ParseBitcodeFile(Buffer, &ErrorMessage));
192 delete Buffer;
193
194192 } else {
195193 M.reset(ParseBytecodeFile(InputFilename,
196194 Compressor::decompressToNewBuffer,