[LLVMdev] Private headers and testing

Chris Lattner clattner at apple.com
Fri Jan 2 12:54:43 PST 2009


On Jan 2, 2009, at 12:21 PM, Misha Brukman wrote:

> Hi all,
>
> Reading this doc: http://llvm.org/docs/CodingStandards.html#hl_privateheaders 
> , it suggests putting private implementation details outside of llvm/ 
> include/* to avoid polluting the public header space.  This makes  
> sense, and it works fine, because make enters every directory and  
> hence doesn't need a -I path to include them.
>
> However, unittests need to also #include these headers to be able to  
> test the internal implementations, so here are potential ways to do  
> this:
> 1) Leave headers where they are now; pass in -I$(LLVM_SRC_ROOT) and  
> #include "lib/Transform/..." for the unittests
> 2) Same as above, except with -I$(LLVM_SRC_ROOT)/lib and #include  
> "Transform/..."
> 3) Create a new header directory for internal headers, e.g. llvm/ 
> include/llvm/internal/ and put private headers there; no one needs  
> any new -I switches, implementation libraries and unittests all say  
> #include "llvm/internal/*" and all is well.  If there's a concern  
> that we are distributing/installing private headers, we can amend  
> the install script to "rm -rf llvm/include/internal" to avoid the  
> issue.

Do you have a specific example of a unit test that would need these?   
I really think these should stay private.

-Chris 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090102/ead1622b/attachment.html>


More information about the llvm-dev mailing list