[LLVMdev] dependent passes

Chris Lattner sabre at nondot.org
Wed Sep 27 11:26:20 PDT 2006


On Wed, 27 Sep 2006, Ryan M. Lefever wrote:
> I think that we are talking about two different things.  I understand
> that in order to use LLVM classes you must either qualify them with the
> llvm namespace or use the statement "using namespace llvm;"  What I'm
> saying is that it has been my experience that when a pass Y depends on
> another pass X, i.e, Y is a required analysis of X, then Y must be
> defined within the llvm namespace rather than in an anonymous namespace
> as http://llvm.org/docs/WritingAnLLVMPass.html suggests it should be.
> I'm wondering if that is correct, or if I'm missing something.

If X depends on Y, and Y is defined in another file in an anonymous 
namespace, there is no way for X to refer to Y.  This is how C++ anonymous 
namespaces work, which doesn't have anything to do with passes.

I've used passes defined in other (non-anon) namespaces, and they seem to 
work fine.  Can you elaborate on the problem you're seeing?

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list