[llvm-commits] [llvm] r121959 - /llvm/trunk/tools/llvm-dis/llvm-dis.cpp

Daniel Dunbar daniel at zuster.org
Thu Dec 16 18:29:17 PST 2010


On Thu, Dec 16, 2010 at 1:36 AM, Frits van Bommel <fvbommel at gmail.com> wrote:
> On Thu, Dec 16, 2010 at 5:36 AM, Daniel Dunbar <daniel at zuster.org> wrote:
>>   OwningPtr<MemoryBuffer> BufferPtr;
>>
>> -  if (ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr))
>> +  if ((ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr)))
>>     ErrorMessage = ec.message();
>>   else
>>     M.reset(ParseBitcodeFile(BufferPtr.get(), Context, &ErrorMessage));
>> -  MemoryBuffer *Buffer = BufferPtr.take();
>> +  (void) BufferPtr.take();
>
> Shouldn't this just use .take() instead of .get() in the 'else'
> branch? (BufferPtr should be null if there was an error, right?)

Probably, but I don't think I just disable compiler warnings and leave
thinking to the original author...

 - Daniel




More information about the llvm-commits mailing list