[patch] clang-cl: Remove -isystem, add -imsvc, expose -nostdlibinc

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 11 19:16:08 PDT 2016


Hi,

r260990 exposed -isystem in clang-cl. -isystem adds a directory to the
front of the system include search path. The idea was to use this to point
to a hermetic msvc install, but as it turns out this doesn't work: -isystem
then adds the hermetic headers in front of clang's builtin headers, and
clang's headers that are supposed to wrap msvc headers (say, stdarg.h)
aren't picked up at all anymore.

So revert that, and instead expose -imsvc which works as if the passed
directory was part of %INCLUDE%: The header is treated as a system header,
but it is searched after clang's lib/Header headers.

Also expose -nostdlibinc so that clang-cl can be told to not look for
system headers in the usual places.

With this change, it's possible to use -imsvc to point clang-cl at a
hermetic MSVC installation and not make it look at the headers of a
possibly installed msvc. Fixes PR26751.

I'd upload this to phab, but it's currently down.

Nico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160411/8a6bd89e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-cl-imsvc.patch
Type: application/octet-stream
Size: 4148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160411/8a6bd89e/attachment-0001.obj>


More information about the cfe-commits mailing list