[llvm-commits] bug fix proposal

Hans Vandierendonck hvdieren at elis.UGent.be
Tue Aug 24 11:03:19 PDT 2010


I am looking into this.
I find one difficulty in LLParser.cpp, where the convention is that  
all ParseXXX() functions return an instruction that must still
be inserted in the BB's instruction list. The actual insertion is done  
once for all ParseXXX() results.
I see 2 options:
1) add InstNormalNoInsert and InstExtraCommaNoInsert enum values to  
bypass the insertion
2) remove the instruction in this case only after the CreateMalloc()  
call
Neither of them is satisfactory.
Any suggestions?

Hans.

On Aug 24, 2010, at 7:33 PM, Chris Lattner wrote:

>
> On Aug 24, 2010, at 7:28 AM, Hans Vandierendonck wrote:
>
>> Hi,
>>
>> The attached patch fixes a bug in lib/VMCore/Instructions.cpp,  
>> createMalloc() routine, where a BitCastInst is not inserted in any  
>> BasicBlock.
>
> This is not correct, because of an incredibly poor design of  
> CreateMalloc: it looks like the "InsertAtEnd" version does not  
> insert the final instruction into the specified block!  This is  
> terrible, but you'd need to fix the callers before this patch will  
> work.
>
> -Chris

====
Hans Vandierendonck
Post-doctoral Fellow FWO
Department of Electronics and Information Systems
Ghent University
http://www.elis.ugent.be/~hvdieren/




More information about the llvm-commits mailing list