[LLVMdev] DEBUG

David Greene dag at cray.com
Mon Jul 7 11:36:38 PDT 2008


On Monday 07 July 2008 13:31, Chris Lattner wrote:
> On Mon, 7 Jul 2008, David Greene wrote:
> > Some time ago I ran into problems with conflicts because the LLVM DEBUG
> > macro and macros defined by our internal software here.  I worked around
> > it but it is ugly.
> >
> > This just came up again today.  The fundamental problem is that two
> > pieces of software both use the generic name "DEBUG."  This is just
> > problems waiting to happen.  We need some kind of namespace.
> >
> > Would the LLVM community be open to changing DEBUG to something like
> > LLVM_DEBUG?  I am pushing to have our code be changed in a similar way.
>
> Debug.h should only be #included by .cpp files, not .h files.  Are you
> seeing a case where you need to use both debug macros in a .cpp file?

That's not the issue.  We have some interface (.cpp) files that convert from 
our IR to LLVM IR.  Those files need to include headers from both LLVM and
our compiler components.  That is where the DEBUG conflict happens.

                                                              -Dave



More information about the llvm-dev mailing list