[LLVMdev] Problem using ilist container

abhishek Singh abh.spark at gmail.com
Fri Jan 16 02:32:47 PST 2009


Hi All,
I have just started using LLVM .
i am facing a issue while using ilist container.

Here is a struct with ilist container as its one element.

typedef ilist<Instruction *> InstListType;
              struct list_node {
                                    int Impact;
                                    InstListType  InstList;

                                   };
list_node *BB_list=new struct list_node[10];
Instruction *user= { pointing to some instruction object }

//trying to add instruction pointer to ilist.
// this is where i am getting error. ( please find error file attached).

BB_list[index].InstList.push_back(user);

Any thoughts on what's causing this error??


 Thanks,
Abhishek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090116/18390546/attachment.html>
-------------- next part --------------
/usr/local/llvm/src/include/llvm/ADT/ilist.h: In static member function 'static NodeTy* llvm::ilist_nextprev_traits<NodeTy>::getPrev(NodeTy*) [with NodeTy = llvm::Instruction*]':
/usr/local/llvm/src/include/llvm/ADT/ilist.h:268:   instantiated from 'NodeTy* llvm::iplist<NodeTy, Traits>::getTail() [with NodeTy = llvm::Instruction*, Traits = llvm::ilist_traits<llvm::Instruction*>]'
/usr/local/llvm/src/include/llvm/ADT/ilist.h:306:   instantiated from 'llvm::iplist<NodeTy, Traits>::~iplist() [with NodeTy = llvm::Instruction*, Traits = llvm::ilist_traits<llvm::Instruction*>]'
/usr/local/llvm/src/include/llvm/ADT/ilist.h:574:   instantiated from here
/usr/local/llvm/src/include/llvm/ADT/ilist.h:55: error: request for member 'getPrev' in '* N', which is of non-class type 'llvm::Instruction*'
/usr/local/llvm/src/include/llvm/ADT/ilist.h: In static member function 'static void llvm::ilist_nextprev_traits<NodeTy>::setNext(NodeTy*, NodeTy*) [with NodeTy = llvm::Instruction*]':
/usr/local/llvm/src/include/llvm/ADT/ilist.h:277:   instantiated from 'void llvm::iplist<NodeTy, Traits>::CreateLazySentinal() const [with NodeTy = llvm::Instruction*, Traits = llvm::ilist_traits<llvm::Instruction*>]'
/usr/local/llvm/src/include/llvm/ADT/ilist.h:319:   instantiated from 'llvm::ilist_iterator<NodeTy> llvm::iplist<NodeTy, Traits>::end() [with NodeTy = llvm::Instruction*, Traits = llvm::ilist_traits<llvm::Instruction*>]'
/usr/local/llvm/src/include/llvm/ADT/ilist.h:609:   instantiated from 'void llvm::ilist<NodeTy>::push_back(const NodeTy&) [with NodeTy = llvm::Instruction*]'
jImpact.cpp:75:   instantiated from here
/usr/local/llvm/src/include/llvm/ADT/ilist.h:61: error: request for member 'setNext' in '* N', which is of non-class type 'llvm::Instruction*'
/usr/local/llvm/src/include/llvm/ADT/ilist.h: In static member function 'static void llvm::ilist_nextprev_traits<NodeTy>::setPrev(NodeTy*, NodeTy*) [with NodeTy = llvm::Instruction*]':
/usr/local/llvm/src/include/llvm/ADT/ilist.h:270:   instantiated from 'void llvm::iplist<NodeTy, Traits>::setTail(NodeTy*) const [with NodeTy = llvm::Instruction*, Traits = llvm::ilist_traits<llvm::Instruction*>]'
/usr/local/llvm/src/include/llvm/ADT/ilist.h:278:   instantiated from 'void llvm::iplist<NodeTy, Traits>::CreateLazySentinal() const [with NodeTy = llvm::Instruction*, Traits = llvm::ilist_traits<llvm::Instruction*>]'
/usr/local/llvm/src/include/llvm/ADT/ilist.h:319:   instantiated from 'llvm::ilist_iterator<NodeTy> llvm::iplist<NodeTy, Traits>::end() [with NodeTy = llvm::Instruction*, Traits = llvm::ilist_traits<llvm::Instruction*>]'
/usr/local/llvm/src/include/llvm/ADT/ilist.h:609:   instantiated from 'void llvm::ilist<NodeTy>::push_back(const NodeTy&) [with NodeTy = llvm::Instruction*]'
jImpact.cpp:75:   instantiated from here
/usr/local/llvm/src/include/llvm/ADT/ilist.h:60: error: request for member 'setPrev' in '* N', which is of non-class type 'llvm::Instruction*'
/usr/local/llvm/src/include/llvm/ADT/ilist.h: In static member function 'static NodeTy* llvm::ilist_nextprev_traits<NodeTy>::getNext(NodeTy*) [with NodeTy = llvm::Instruction*]':
/usr/local/llvm/src/include/llvm/ADT/ilist.h:379:   instantiated from 'NodeTy* llvm::iplist<NodeTy, Traits>::remove(llvm::ilist_iterator<NodeTy>&) [with NodeTy = llvm::Instruction*, Traits = llvm::ilist_traits<llvm::Instruction*>]'
/usr/local/llvm/src/include/llvm/ADT/ilist.h:407:   instantiated from 'llvm::ilist_iterator<NodeTy> llvm::iplist<NodeTy, Traits>::erase(llvm::ilist_iterator<NodeTy>) [with NodeTy = llvm::Instruction*, Traits = llvm::ilist_traits<llvm::Instruction*>]'
/usr/local/llvm/src/include/llvm/ADT/ilist.h:479:   instantiated from 'llvm::ilist_iterator<NodeTy> llvm::iplist<NodeTy, Traits>::erase(llvm::ilist_iterator<NodeTy>, llvm::ilist_iterator<NodeTy>) [with NodeTy = llvm::Instruction*, Traits = llvm::ilist_traits<llvm::Instruction*>]'
/usr/local/llvm/src/include/llvm/ADT/ilist.h:483:   instantiated from 'void llvm::iplist<NodeTy, Traits>::clear() [with NodeTy = llvm::Instruction*, Traits = llvm::ilist_traits<llvm::Instruction*>]'
/usr/local/llvm/src/include/llvm/ADT/ilist.h:305:   instantiated from 'llvm::iplist<NodeTy, Traits>::~iplist() [with NodeTy = llvm::Instruction*, Traits = llvm::ilist_traits<llvm::Instruction*>]'
/usr/local/llvm/src/include/llvm/ADT/ilist.h:574:   instantiated from here
/usr/local/llvm/src/include/llvm/ADT/ilist.h:56: error: request for member 'getNext' in '* N', which is of non-class type 'llvm::Instruction*'
gmake: *** [/usr/local/llvm/src/lib/jimp/Release/jImpact.lo] Error 1


More information about the llvm-dev mailing list