[LLVMdev] How to get the Operand type

khaled hamidouche khaledhamidouche at gmail.com
Fri Apr 23 05:08:04 PDT 2010


Hello

How to get the type of an Operand ?

so for example I want to get the type of the operand(0) in this istruction

 %arrayidx22 = getelementptr [1000 x double]* %C, i64 0, i64 %indvar67 ;
<double*> [#uses=1]

I tried    (II->getOperand(0))->getType() ) but this give me an adress (I
think) (some think like 0x1253.. )

also I tried to get the type of the instruction with

switch (II->getType()->getTypeID()) {    case Type::FloatTyID:
                                                          case
Type::DoubleTyID:
                                                          case
Type::IntegerTyID:
                                                          default: ;
                                                      }

It works well exept for the  getelementptr instruction !!!  ??

so Please how to get the Operand type ? (I mean that tell me it is a Double
or a float .... )

Thank you so much
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100423/74d9945e/attachment.html>


More information about the llvm-dev mailing list