[LLVMdev] Headers & Libraries

Reid Spencer reid at x10sys.com
Fri Nov 14 12:53:02 PST 2003


On Fri, 2003-11-14 at 10:52, Chris Lattner wrote:

> > > While LLVM is slowly moving that direction, we are not yet considered to
> > > be required by the "system".
> >
> > Yes they define as "system" headers files that declare interfaces to parts of
> > the OS (cpp info, section Header Files). Of couse what is defined as OS is
> > not mentioned anywhere so you can define that as you like. Personally I
> > believe it is not just the kernel but also all packages installed in standard
> > directories. So what they call "system" headers are basically installed
> > headers and user headers are internal ones. In the context of llvm every
> > header that is under inlcude is a "system" header (because when we write an
> > install target it will end up in /usr/include/llvm) otherwise it is a user
> > header.
> 
> I'm sorry, but at this point I don't see the value of making this change.
> It would be a lot of work for no clear benefit.  Even if/when llvm headers
> get installed into /usr/include/llvm, you can still use "" to get them.
> For most practical purposes, all <> vs "" do is change the order of the
> search path.  Am I missing something here, or is this just a matter of a
> personal preference?
> 
> -Chris

No, you're not missing anything but it isn't just a matter of taste.
Installed headers should be included
with <> because it is "slightly" more efficient (the local compilation
directory is not searched first). Both
will work.  However, I think Alkis' point is exactly right. LLVM headers
(most of them) should be considered
system headers and #included with <>.  LLVM also has some non-public
headers. Those should be
#included with "". 

Let's not make the amount of work involved here the issue. I'd do the
whole thing myself because the
value I see in doing it is that I can clearly identify from a #include
line whether it is a public or private
header file that is being included (based on whether <> or "" is used).

At the risk of being controversial, there is another topics in this area
that I Would bring up:

 I find the separation of header files into the $SRCDIR/include
directory bothersome. It is a real
pain to switch between $SRCDIR/include/llvm/... and $SRCDIR/lib/... 
What was the rationale in
doing this? Shouldn't the header files be located in the same directory
as the .cpp files? The 
install target can sort out where they go when the package is installed.

Reid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20031114/12585632/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20031114/12585632/attachment.sig>


More information about the llvm-dev mailing list