Problem with generating Machine function analysis pass


I've been encountering a problem with function pass manager with llvm-2.6. Somehow system does not know how to create analysis pass if it's required by some other pass.

I got following after adding various debug prints to PassManager.cpp I got following results for my reduced test program which just loads module and then tries to make a function pass manager.

elhigu@mr-lenovo:~/temp$ g++ `llvm-config --cxxflags` -g -o test `llvm-config --ldflags --libs`
elhigu@mr-lenovo:~/temp$ ./test
------------------- finding usage Target Data Layout
------------------- found usage
------------------- check analysis
--------Required set ----------
-------- end ----------
------------------- analysis checked if it was there
------------------- finding usage If Converter
------------------- found usage
------------------- check analysis
--------Required set ----------
Machine Function Analysis
-------- end ----------
---------- finding... Machine Function Analysis
-------------------------------- Oh no no analysis pass
test: /home/elhigu/stow_sources/llvm-2.6-svn/include/llvm/PassSupport.h:111: llvm::Pass* llvm::PassInfo::createPass() const: Assertion `NormalCtor && "Cannot call createPass on PassInfo without default ctor!"' failed.

When I tried to compile the same file with llc Machine Function Analysis pass was created with out problems. Am I missing some pass registration initialisation or something like that? Any ideas what I'm doing wrong?

For many other passes (*I)->createPass() does worked correctly.

I attached modified PassManager.cpp which shows, where the debug strings are coming from and source code of program.

Thanks, Mikael Lepistö ( for instant helping I'm hanging around on #llvm with elhigu nick ) (1.26 KB)

PassManager.cpp (57 KB)