[LLVMdev] Error : llvm/include/llvm/Pass.h:188: error: incomplete type 'llvm::DominatorTree' used in nested name specifier

Surinder surifilms at gmail.com
Sun Jan 30 17:24:19 PST 2011


I am creating a new pass (function pass) called Dfl from the Hello
example and notes on "Writing an LLVM Pass".  When I compile the
program I get inncomplete type error (llvm/include/llvm/Pass.h:188:
error: incomplete type 'llvm::DominatorTree' used in nested name
specifier).  The code is given below.

Surinder

struct Dfl : public FunctionPass {
    raw_ostream *Out;
    static char ID;
    //
    Dfl() : FunctionPass(&ID) { }
    //
    virtual bool runOnFunction(Function &F) {
      // //BlocksCounter++; EdgesCounter++; InstCounter++;
      bool modified=false;
      errs() << "In Dfl for Function : " << F.getName();
      if (F.empty()) errs() << " is empty."  << "\n";
      else errs()  << "\n";
      // DT = &getAnalysis<DominatorTree>();
      modified = printDfl(Out, &F); // , &DT);
      return modified;
    };
    // pass interface to other passes
    virtual void getAnalysisUsage(AnalysisUsage &AU) const {
      AU.setPreservesAll();
      AU.addRequired<DominatorTree>();                 ///  ***error
line ***********
    }


};  // end struc Dfl



More information about the llvm-dev mailing list