[llvm-commits] [llvm] r83324 - /llvm/trunk/lib/Analysis/MallocHelper.cpp

Chris Lattner clattner at apple.com
Tue Oct 6 10:11:35 PDT 2009


On Oct 6, 2009, at 12:16 AM, Török Edwin wrote:

> On 2009-10-06 09:53, Chris Lattner wrote:
>>
>> On Oct 5, 2009, at 11:49 PM, Duncan Sands wrote:
>>
>>> Hi Torok,
>>>
>>>> +  // Check malloc prototype.
>>>> +  // FIXME: this will be obsolete when nobuiltin attribute will  
>>>> exist.
>>>
>>> why would it be obsolete then?  If LLVM sees "malloc" with a funky
>>> prototype it will always need to bail out, no?
>>
>> Why would it in this case?  Though it doesn't make a lot of sense, it
>> wouldn't cause the program to crash, and the code would have  
>> undefined
>> behavior.
>
> Once the LLVM optimizers/backends can emit warnings with line  
> numbers, I
> think we should emit a warning if we see something obviously wrong  
> being
> done,
> like using malloc with a wrong proto without using
> -ffreestanding/nobuiltins, or calling a function with an obviously  
> wrong
> calling convention, etc.

The front-end should generate this warning.

-Chris



More information about the llvm-commits mailing list