Problem using ilist container

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

error.txt (4.49 KB)

Hello,

i am facing a issue while using ilist container.

ilist is an internal container, you should not use it directly. Please
consider reading llvm documentation about how to add / modify
instructions.