Hi, I believe that Module::iterator iterates through all the functions in a program. Am i wrong somewhere? 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) Can someone explain this behavior. regards, Ambika
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
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 >
Apparently Analagous Threads
- [LLVMdev] Basic doubt related to Module::iterator
- [LLVMdev] Basic doubt related to Module::iterator
- [LLVMdev] Basic doubt related to Module::iterator
- [LLVMdev] [Fwd: Error while running my pass with opt]
- [LLVMdev] [Fwd: Error while running my pass with opt]