I am trying to get the users of alloca instruction (to basically get the users of a variable). I am using the following code to do so:
virtual bool runOnModule(Module &M)
{
for(Module::iterator F= M.begin(), E = M.end(); F != E; ++F) // iterating over functions in a module
{
for (Function::iterator FI = F->begin(), E = F->end(); FI != E; ++FI) // iterating over BB in a function
{
for (BasicBlock::iterator I = FI->begin(), E = FI->end(); I != E; ++I) // iterating over instructions in the BB
{
Value* v = cast<Value>(I);
v->user_begin ();
}
}
}
return false;
}
However, it's giving me the error:
error: ‘class llvm::Value’ has no member named ‘user_begin’
Can anyone tell me why this is happening and suggest a possible solution to what I'm trying to do here (get users of a variable)?