]> granicus.if.org Git - clang/commit
Frontend: support -I=path for sysroot expansion
authorSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 6 May 2016 19:13:55 +0000 (19:13 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 6 May 2016 19:13:55 +0000 (19:13 +0000)
commit0f9d5d9db32bcd4e8f1a5a11c71bba3ae86227f7
treee8e77d21d318f2730b82759de33cb0401e45f63c
parentc6a175c3aa43ef8b25f1f33c09880341f090c017
Frontend: support -I=path for sysroot expansion

From the GCC manpage:

  -I dir
    ... If dir begins with =, then the = will be replaced by the sysroot prefix;
    see --sysroot and -isysroot.

Add support to expand the `=` as a prefix of the include path with the sysroot
if specified.  `-isysroot` takes precedence over `--sysroot` as the normal
argument behaviour occurs.  The ordering of the `-isysroot` is relevant to the
path substituted.  If no `--sysroot=` or `-isysroot` option is present, the = is
not expanded.

Resolves PR26965!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268777 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Frontend/CompilerInvocation.cpp
test/Preprocessor/sysroot-prefix.c [new file with mode: 0644]