Displaying 1 result from an estimated 1 matches for "insertonfirstblock".
2012 Aug 22
1
[LLVMdev] Insert Self Written Function Call from a FunctionPass?
...irtual bool runOnFunction(Function &func)
{
count = new AllocaInst(IntegerType::getInt32Ty(Context), 0, "count");
count->setAlignment(4);
for(Function::iterator F = func.begin(), E = func.end(); F!= E; ++F)
{
if(F == func.begin())
{
bishe_insert::insertOnFirstBlock(F);
}
bishe_insert::runOnBasicBlock(F);
}
return false;
}
/*insert alloca instruction in the start of the first basic block*/
virtual bool insertOnFirstBlock(Function::iterator &BB)
{
for(BasicBlock::iterat...