newbie with pass registering Problem

Hi John!!

1) Have you ensured that your passes have different arguments to the =

RegisterPass constructor (i.e., they have different names)?

Yes, I only write one Pass (Function Pass) and gave it that one name.

2) Are you sure that variable X is only being defined once? There are =

some ways in which you could have unintentionally defined it twice. For =

example, if you put the RegisterPass line in a header file that is =

included by multiple source files in your pass's source code, it will be =

defined multiple times, possibly giving rise to this error. In our =

code, we use RegisterPass inside a single .cpp file to ensure it's only =

defined once.

Yes, I'm sure. I wrote the Pass and the RegisterPass also in a .cpp file, like this:


using namespace std;
using namespace llvm;

namespace {

class FunctionAnalysis : public FunctionPass
     static char ID;
     FunctionAnalysis() : FunctionPass((intptr_t)&ID) {} // Konstruktor ruft Funktionsdurchlauf auf
     ~FunctionAnalysis() {}
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     virtual bool runOnFunction(Function &F) // F is a pointer to a Function instance
        GenomManager *GGenomManager;
        GGenomManager=new GenomManager();
        blockNrs &bnrs=getAnalysis<blockNrs>();
          for(Function::iterator b = F.begin(), be = F.end(); b!=be; ++b)
                //aktuelle Block Nummer wird geholt
                blockCounter *bcntr = bnrs.lookup(b);
                for(BasicBlock::iterator i = b->begin(), ie = b->end(); i!=ie; ++i)

                  }// end for BB
          } // end for Function
          return false;

     } // end runOnFunction


};// end class

char FunctionAnalysis::ID = 0;
RegisterPass<FunctionAnalysis> X("gasched", "GA Scheduling Pass");

} // end namespace

Could it be that I did something wrong in the Makefile of the source code? The source code itself is compilable. The Error Message occurred when I tried to test it ("opt -load" its .so file ) .

Thanks a lot...