Hi,<div><br></div><div>Thanks for your last reply.</div><div>Could I understand the way to adding a pass (built into the llvm rather than dynamic loadable) includes:</div><div>1. Declaring a creator function for this pass</div>
<div>2. Implementing the creator function for this pass</div><div>3. Instantiating this pass and get a object of it</div><div>3. Register this pass into the PassRegistry</div><div><br></div><div>Then, for a built-into bytecode pass,  </div>
<div>         task 1(declaration of the creator) should be done in Scalar.h; </div><div>         task 2(implementation of the creator) should be done the related mypass.cpp file;</div><div>         task 3(instantiation of the pass class) should be done in LinkAllPasses.h;</div>
<div>         task 4(registration of the pass into the PassRegistry) should be done by INITIALIZE_PASS</div><div>class LiveVariables : public MachineFunctionPass is a case of point.</div><div><br></div><div>For a built-into codegen/MachineCode pass, </div>
<div>         task 1 should be done in Passes.h;</div><div>         task 2 should be done in the related mypass.cpp file;</div><div>         task 3 should be done in LLVMTargetMachine.cpp</div><div>         task 4 should be done by INITIALIZE_PASS</div>
<div> class IntervalAnalylsis: public MachineFunctionPass is a case in point.</div><div><br></div><div>I have implemented a new mypass (just for analysis, rather than transformation) as a subclass of MchineFunctionPass, and finished task 1, 2, 4. But I don't know how to finish task 3, since I failed to make clear how the class IntervalAnalysis did task 3. So I need your help. <br clear="all">
<br>-- <br>Best regards,<div><br></div><div>Li Qingan</div><br>
</div>