[LLVMdev] Is this value an integer type?

Zheng Wang jason.wangz at gmail.com
Mon May 17 08:00:54 PDT 2010


Thanks all!!
Problem Solved. :)

2010/5/17 Török Edwin <edwintorok at gmail.com>:
> On 05/17/2010 05:02 PM, Zheng Wang wrote:
>> Hello,
>>
>> I have a problem of dumping a value. Here is the llvm assembly code:
>>
>> ---
>>  %322 = getelementptr inbounds [76 x [4 x i8]]* @i_tc0_table, i32 0,
>> i32 %305, i32 %321 ; <i8*> [#uses=1]
>>  %323 = load i8* %322, align 1                   ; <i8> [#uses=1]
>>  store i8 %323, i8* %89, align 1
>> --
>>
>> I want to dump %323 to a library function whose prototype is:
>>
>> recordStore(const char*, unsigned int, unsigned, int)
>
> To pass an i8 as i32 you need either sign-, or zero-extension, i.e.
> %324 = zext i8 %323 to i32
> call %recordStore(null, %324, i32 0)
>
> For example.
>> ***** Why %323  is different from the Integer type I has declared?
>
> i8 and i32 are different types
>
>
> Best regards,
> --Edwin
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



-- 
Best regards,

WANG Zheng




More information about the llvm-dev mailing list