[LLVMdev] How To Get The Name of the type the popinter is pointing to

amitjai amitjaiswal.knit at gmail.com
Thu Sep 20 20:11:22 PDT 2012


i am using llvm ,
i did this 

                        if (  AllocaInst *allocInst =
dyn_cast<AllocaInst>(&*bbit)){
                                PointerType *p = allocInst->getType();
                                if ( p->getElementType()->isPointerTy()){
                                        StringRef name =
allocInst->getName();
                                        Type *type =
allocInst->getOperand(0)->getType();;
                                        errs() << type->getName() << "   "
<< name << "\n";
                                }
                        }

but i am getting the output in the following format

i32   line
i32   temp
i32   p
i32   filename
i32   arrays
i32   label
i32   fp
i32   head
i32   b

here line is char* ,temp is char* , p is int pointer,fp is file pointer
,head is pointer to list node structure and so on

but why i am getting i32 for all the pointers .

please help me out.



--
View this message in context: http://llvm.1065342.n5.nabble.com/How-To-Get-The-Name-of-the-type-the-popinter-is-pointing-to-tp49121p49157.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.



More information about the llvm-dev mailing list