mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
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
This commit is contained in:
parent
03b6963762
commit
db9cbeb240
@ -184,14 +184,12 @@ int main(int argc, char **argv) {
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user