[LLVMdev] dependent passes

Devang Patel dpatel at apple.com
Tue Sep 26 18:37:40 PDT 2006

On Sep 26, 2006, at 5:49 PM, Ryan M. Lefever wrote:

> I am trying to create two passes X and Y, in which pass X depends on
> pass Y.  After attempting this several times it appears that pass Y  
> must
> be in the llvm namespace.  Whenever it was not in the llvm namespace,
> "opt -load" would complain about undefined symbols when I called
> getAnalysis<>(). Am I correct that the pass that is depended on must  
> be
> in the llvm namespace?  If so, that was not clear in the documentation
> regarding writing an LLVM pass.

http://llvm.org/docs/WritingAnLLVMPass.html says,

Basic code required
Now that we have a way to compile our new pass, we just have to write  
it. Start out with:

#include "llvm/Pass.h"
#include "llvm/Function.h"
Which are needed because we are writing a Pass, and we are operating  
on Function's.

Next we have:

using namespace llvm;
... which is required because the functions from the include files  
live in the llvm namespace.




More information about the llvm-dev mailing list