[llvm-dev] RFC: clang option to tolerate Windows-style #include paths?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] RFC: clang option to tolerate Windows-style #include paths?

Robin Eklind via llvm-dev
Hello llvm-dev,

I've written a draft patch to allow clang to tolerate "Windows-isms" - backslash path separators and inconsistent case in filenames - in the pathnames appearing in #include directives, even when its host platform is not Windows.

For example, something like #include "subdir\HEADER.H" would be initially reinterpreted as "subdir/HEADER.H", and then, if the file didn't exist, clang would check each component of the pathname for a case-insensitive match, so that if the file turned out to be called, say, "Subdir/Header.h" then it would still find it.

The idea is to make life easier for people compiling Windows-specific code bases on (say) Linux, either because they're cross-compiling them with clang-cl, or because they're developing a port of the code base. If the owner of the code base won't take patches to make the #includes more portable, then it can be useful to have the fallback option of making clang tolerate the nonportable versions.

It's nowhere near finished yet, but before I put more effort into polishing it up, I thought I'd check to see if this is a feature anyone else thinks would be useful, and also make sure I'm not going about it in totally the wrong way.

The draft is at https://reviews.llvm.org/D48626 , if anyone's interested.

Cheers,
Simon
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] RFC: clang option to tolerate Windows-style #include paths?

Robin Eklind via llvm-dev
Hi Simon,

This is probably more a cfe-dev question. I've added them to the
circulation here, apologies for the inevitable quotation mess.

Tim.

On Wed, 27 Jun 2018 at 11:27, Simon Tatham via llvm-dev
<[hidden email]> wrote:

> I've written a draft patch to allow clang to tolerate "Windows-isms" - backslash path separators and inconsistent case in filenames - in the pathnames appearing in #include directives, even when its host platform is not Windows.
>
> For example, something like #include "subdir\HEADER.H" would be initially reinterpreted as "subdir/HEADER.H", and then, if the file didn't exist, clang would check each component of the pathname for a case-insensitive match, so that if the file turned out to be called, say, "Subdir/Header.h" then it would still find it.
>
> The idea is to make life easier for people compiling Windows-specific code bases on (say) Linux, either because they're cross-compiling them with clang-cl, or because they're developing a port of the code base. If the owner of the code base won't take patches to make the #includes more portable, then it can be useful to have the fallback option of making clang tolerate the nonportable versions.
>
> It's nowhere near finished yet, but before I put more effort into polishing it up, I thought I'd check to see if this is a feature anyone else thinks would be useful, and also make sure I'm not going about it in totally the wrong way.
>
> The draft is at https://reviews.llvm.org/D48626 , if anyone's interested.
>
> Cheers,
> Simon
> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev