[LLVMdev] Using Function Passes from Module Passes

John Criswell criswell at cs.uiuc.edu
Mon Dec 3 14:59:45 PST 2007


Dear All,

I'm having some problems using a function pass from a Module pass.  My
code is as follows:

DominatorTree & domTree;
...
Function &F = *I; // I is an interator from using Module::begin()
...
domTree = getAnalysis<DominatorTree>(F);

When I compile this code, I get the following error:


/home/vadve/criswell/src/llvm22/include/llvm/Pass.h: In member function
'llvm::FunctionPass& llvm::FunctionPass::operator=(const
llvm::FunctionPass&)':
/home/vadve/criswell/src/llvm22/include/llvm/Pass.h:85: error: 'void
llvm::Pass::operator=(const llvm::Pass&)' is private
/home/vadve/criswell/src/llvm22/include/llvm/Pass.h:286: error: within
this context
/home/vadve/criswell/src/llvm22/include/llvm/Analysis/Dominators.h: In
member function 'llvm::DominatorTree&
llvm::DominatorTree::operator=(const llvm::DominatorTree&)':
/home/vadve/criswell/src/llvm22/include/llvm/Analysis/Dominators.h:659:
note: synthesized method 'llvm::FunctionPass&
llvm::FunctionPass::operator=(const llvm::FunctionPass&)' first required
here
/home/vadve/criswell/src/llvm22/projects/safecode/lib/ArrayBoundChecks/ArrayBoundCheck.cpp:
In member function 'virtual bool
llvm::ABC::ArrayBoundsCheck::runOnModule(llvm::Module&)':
/home/vadve/criswell/src/llvm22/projects/safecode/lib/ArrayBoundChecks/ArrayBoundCheck.cpp:905:
note: synthesized method 'llvm::DominatorTree&
llvm::DominatorTree::operator=(const llvm::DominatorTree&)' first
required here

Does anyone know what I'm doing wrong?

Regards,

John Criswell




More information about the llvm-dev mailing list