[LLVMdev] Pass is not automatically registered

Tzu-Chien Chiu tzuchien.chiu at gmail.com
Mon Sep 5 04:41:25 PDT 2005


I am not sure if my problem is similar to:
  http://lists.cs.uiuc.edu/pipermail/llvmdev/2003-December/000715.html

It seems that the constructor of the static global pass object isn't called:

lib/CodeGen/DependenceAnalyzer.cpp:

static RegisterAnalysis<DependenceAnalyzer> X("depana", "Dependence Analysis");

I traced into struct RegisterAnalysis ctor, but my pass doesn't
appear. I put it in an anonymous namespace, it doesn't work too.


The class definitions:

class DependenceAnalyzer : public MachineFunctionPass {
  virtual void getAnalysisUsage(AnalysisUsage &AU) const {
    AU.setPreservesAll();
    AU.addRequired<LiveIntervals>();
    AU.addRequired<LiveVariables>();    
    MachineFunctionPass::getAnalysisUsage(AU);
  }

class RegAllocMultibank : public MachineFunctionPass {
    virtual void getAnalysisUsage(AnalysisUsage &AU) const {
      AU.addRequired<LiveIntervals>();
      AU.addRequired<DependenceAnalyzer>();
      MachineFunctionPass::getAnalysisUsage(AU);
    }
};

-- 
Tzu-Chien Chiu,
3D Graphics Hardware Architect
<URL:http://www.csie.nctu.edu.tw/~jwchiu>




More information about the llvm-dev mailing list