<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;"><div>Hi,
<br><br>I try to write a FunctionPass that, among other tasks, has to clone some loops from the current function.
<br>How can I obtain the LPPassManager in order to use the CloneLoop function.
<br>In a LoopPass this is a parameter for the runOnLoop, but how can I obtain it in a FunctionPass?<br>I tried simply by creating a new instance :
<br><br>        ValueMap<const Value *, Value* > VMap;
<br>        LoopInfo *LI = &getAnalysis<LoopInfo>(); 
<br>        LPPassManager *LPM = new llvm::LPPassManager(1);
<br><br>        Loop* nL = llvm::CloneLoop(L, LPM, LI, VMap, this);
<br><br>but it segfaults in CloneLoop when trying LPM->insertLoop(..).
<br><br>Does the CloneLoop function include both loops in the CFG and 
re-create the use map between the clones?<br>Also does it update the phi nodes to use either the original or the cloned values?
<br><br>Thank you for your help,
<br><br>Alexandra</div>



</div></body></html>