diff options
| author | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-06-17 17:23:16 +0000 |
|---|---|---|
| committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-06-17 17:23:16 +0000 |
| commit | 88879e6559a3ae8593e32568900707b1dbf3f060 (patch) | |
| tree | 14db345a4c1dd5a26a7f2dd411775803709aff32 /clang/lib/Driver | |
| parent | b5044fe4211877042384ef93d996c35622baf6ca (diff) | |
| download | bcm5719-llvm-88879e6559a3ae8593e32568900707b1dbf3f060.tar.gz bcm5719-llvm-88879e6559a3ae8593e32568900707b1dbf3f060.zip | |
Driver: introduce and use `-isystem-after` for cross-windows
This mirrors the many other -i*after options to insert a new system search
directory at the end of the search path. This makes it possible to actually
inject a search path after the resource dir. This option is similar in spirit
to the /imsvc option in the clang-cl driver. This is needed to properly use the
driver for Windows targets where the clang headers wrap some of the system
headers.
This concept is actually useful on other targets (e.g. Linux) and would be
really easy to support on the core toolchain.
llvm-svn: 273016
Diffstat (limited to 'clang/lib/Driver')
| -rw-r--r-- | clang/lib/Driver/CrossWindowsToolChain.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Driver/CrossWindowsToolChain.cpp b/clang/lib/Driver/CrossWindowsToolChain.cpp index 57bf8963598..4ebbc533232 100644 --- a/clang/lib/Driver/CrossWindowsToolChain.cpp +++ b/clang/lib/Driver/CrossWindowsToolChain.cpp @@ -62,6 +62,8 @@ AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::sys::path::append(ResourceDir, "include"); addSystemInclude(DriverArgs, CC1Args, ResourceDir); } + for (const auto &P : DriverArgs.getAllArgValues(options::OPT_isystem_after)) + addSystemInclude(DriverArgs, CC1Args, P); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); } diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 62738e66990..b911c17e2bc 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -502,6 +502,13 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, << A->getAsString(Args); } } + } else if (A->getOption().matches(options::OPT_isystem_after)) { + // Handling of paths which must come late. These entries are handled by + // the toolchain itself after the resource dir is inserted in the right + // search order. + // Do not claim the argument so that the use of the argument does not + // silently go unnoticed on toolchains which do not honour the option. + continue; } // Not translated, render as usual. |

