Dear Owen, Are passes supposed to grab the LLVMContext from the Module/Function/BasicBlock passed into their runOn<Module/Function/BasicBlock> method, or is the PassManager supposed to set the pass's Context member variable automatically? I thought it was the latter, but after an SVN update of LLVM, my passes have a NULL Context, and the LLVM code looks like the passes are all setting their Context member variable explicitly. -- John T.
Dear John, I think you must call (YourPassManager)->doInitialization() to set the LLVMContext object. Nicolas John Criswell wrote:> Dear Owen, > > Are passes supposed to grab the LLVMContext from the > Module/Function/BasicBlock passed into their > runOn<Module/Function/BasicBlock> method, or is the PassManager supposed > to set the pass's Context member variable automatically? > > I thought it was the latter, but after an SVN update of LLVM, my passes > have a NULL Context, and the LLVM code looks like the passes are all > setting their Context member variable explicitly. > > -- John T. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Nicolas Geoffray wrote:> Dear John, > > I think you must call (YourPassManager)->doInitialization() to set the > LLVMContext object. >I'm instantiating a regular PassManager object in my command-line tool. I don't believe the PassManager has a doInitialization() method, so I don't think the above fixes my problem. -- John T.> Nicolas > > John Criswell wrote: > >> Dear Owen, >> >> Are passes supposed to grab the LLVMContext from the >> Module/Function/BasicBlock passed into their >> runOn<Module/Function/BasicBlock> method, or is the PassManager supposed >> to set the pass's Context member variable automatically? >> >> I thought it was the latter, but after an SVN update of LLVM, my passes >> have a NULL Context, and the LLVM code looks like the passes are all >> setting their Context member variable explicitly. >> >> -- John T. >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Seemingly Similar Threads
- [LLVMdev] LLVMContext: Who Creates It?
- [LLVMdev] LoopPass doFinalization() called multiple times per program?
- [LLVMdev] LoopPass doFinalization() called multiple times per program?
- [LLVMdev] MAJOR API CHANGE: LLVMContext
- [LLVMdev] MAJOR API CHANGE: LLVMContext