[LLVMdev] Basic doubt related to Module::iterator

ambika ambika at cse.iitb.ac.in
Fri May 28 14:06:08 PDT 2010


Hi,

Yeah I found that it is running LLVM's functions. The functions that are 
running are:

main
llvm.dbg.func.start
llvm.dbg.stoppoint
scanf
llvm.dbg.region.end

But I dont want all the functions to be called as I am using Dominator 
Trees and whenever I the statement

  DominatorTree &DT = getAnalysis<DominatorTree>(F);

is encountered by functions other than main, it gives error.

What can I do?


regards,
Ambika

Trevor Harmon wrote:
> On May 24, 2010, at 12:58 PM, ambika wrote:
>
>> I run this for different files, each having one function each ie main(),
>> but for one it loops  twice, and for another it loops thrice.
>> for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
>
> It might be iterating over the LLVM intrinsic functions as well as the 
> user-defined functions. Try printing out the function names on each 
> iteration and see what you get.
>
> Trevor
>




More information about the llvm-dev mailing list