[LLVMdev] llvm-gcc

Nabila ABDESSAIED nabila.abdessaied at gmail.com
Fri Apr 22 08:42:06 PDT 2011


>>  i would like to add the value of  the size od a basic bloc to this
>>> global variable
>>> how to convert the size of a basic bloc to integer?
>>
>> Size = number of LLVM IR instructions there? If yes, just grab the
>> number, convert it to ConstantIn and use as an initializer / store to
>> variable.
>>
>
> There's a typo in the above sentence.  ConstantIn should be ConstantInt.
> :)
>
> -- John T.
>
>

//i->size() is the nuber of instruction in the bloc i
hi i tried to convert it to constant but it does'nt work, here what i have done
 const  int n= cast <int> (i->size());
ConstantInt* inValue =  & llvm::cast< llvm::ConstantInt>(n); // it does'nt work
any help?




More information about the llvm-dev mailing list