"Cannot call createPass on PassInfo without default ctor!"

While trying to add a pass to the ARM back end I'm getting quite a lot of this assertion failure:

Pass.cpp:255: llvm::Pass* llvm::PassInfo::createPass() const: Assertion `NormalCtor && "Cannot call createPass on PassInfo without default ctor!"' failed.

A simple way to get it is to add two lines to ARMTargetMachine.cpp:

#include "llvm/Transforms/Scalar.h"



in addInstSelector just before this line:

  PM.add(createARMISelDag(*this, OptLevel));

Then run anything through the ARM back end, for example:

clang -cc1 -triple thumbv7-eabi -O3 -target-cpu cortex-a8 x.c -S -o x.s

The interesting thing is that the assertion failure doesn't happen during the call to createSinkingPass(), which I added, but during the call to createARMISelDag in the following line.

Can anyone tell me what's going on here?

(I've also tried adding the Hello pass, with the same result.)



Hello, Edmund


Is your pass a MachineFunctionPass or just FunctionPass ?