<div dir="ltr">Hello,<div style>  I want to insert a control-block before every outermost loop. My current solution is: 1) find each outermost loop in some function; 2) find the loop header with Loop->getHeader() APIs, and then insert the controller block before the header block of current loop.</div>
<div style><br></div><div style>But I encounters problems when there multi subsequent loops in the following example, where there is no code between loops:</div><div style><br></div><div style>for( i = 0 ; i < N; i++){</div>
<div style>   arrayA[i] = i + 1;</div><div style>}</div><div style><br></div><div style><br></div><div style><div>for( j = 0 ; j < N; j++){</div><div>   arrayA[j] = j + 1;</div><div>}</div><div><br></div><div><br></div>
<div><div>for( k = 0 ; k < N; k++){</div><div>   arrayC[k] = k + 1;</div><div>}</div></div><div><br></div><div style>In this case, these loops have the same header block, so the previous method failed.  And it seems the method of block_begin() returns the same value as getHeader(). </div>
<div style>Are there some other methods to implement this ?</div><div style><br></div><div style>Thanks!</div><div style><br></div><div style>Eric</div></div></div>