[cfe-dev] header maps

Ben Langmuir blangmuir at apple.com
Tue Mar 4 20:47:31 PST 2014


On Mar 4, 2014, at 4:59 PM, Mathieu Baudet <mathieu.baudet at gmail.com> wrote:

> Hi,
> 
> Is there a recommended way to create header maps for clang?
>  http://clang.llvm.org/doxygen/HeaderMap_8h_source.html

Unfortunately no.  There aren’t any clang tools that *produce* a header map, and I think Xcode is the only client right now.

However, depending on what you’re trying to do, you might be better off looking at the new virtual file system code that we’ve been adding to clang. Like header maps, the VFS will allow you to map a virtual path to a file in a different location.  It is also much easier to produce the VFS files, as there is libclang API for producing them in include/clang-c/BuildSystem.h.  Right now the best way to learn how to use the VFS is probably to look at the tests in clang/test/VFS and the libclang API code, and I’d be happy to answer any questions about it :)

> 
> How difficult/acceptable would it be to make the lookup
> case-sensitive? (at least for non mac users)
>  http://clang.llvm.org/doxygen/HeaderMap_8cpp_source.html#l00229

The VFS supports selecting between case-sensitive and case-insensitive (this hasn’t been exposed in the libclang API yet, but it would be easy to do).  That said, If you really want to hack it in to header maps, it wouldn’t be hard - there are two places in HeaderMap.cpp that drop to lower case before doing the comparison that you would need to change.

Ben


> 
> Thanks!
> --
> Mathieu
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev





More information about the cfe-dev mailing list