]> granicus.if.org Git - clang/commitdiff
Add -iframeworkwithsysroot compiler option
authorAlex Lorenz <arphaman@gmail.com>
Mon, 13 Mar 2017 11:17:41 +0000 (11:17 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Mon, 13 Mar 2017 11:17:41 +0000 (11:17 +0000)
This commit adds support for a new -iframeworkwithsysroot compiler option which
allows the user to specify a framework path that can be prefixed with the
sysroot. This option is similar to the -iwithsysroot option that exists to
supplement -isystem.

rdar://21316352

Differential Revision: https://reviews.llvm.org/D30183

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297614 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Options.td
lib/Frontend/CompilerInvocation.cpp
test/Frontend/iframework.c

index 9dd80c09184ce499680862565301d56d2ddcdaf4..7952b33fd5e8efd8b55e8aff8b9aadbea842c557 100644 (file)
@@ -1524,6 +1524,11 @@ def idirafter : JoinedOrSeparate<["-"], "idirafter">, Group<clang_i_Group>, Flag
   HelpText<"Add directory to AFTER include search path">;
 def iframework : JoinedOrSeparate<["-"], "iframework">, Group<clang_i_Group>, Flags<[CC1Option]>,
   HelpText<"Add directory to SYSTEM framework search path">;
+def iframeworkwithsysroot : JoinedOrSeparate<["-"], "iframeworkwithsysroot">,
+  Group<clang_i_Group>,
+  HelpText<"Add directory to SYSTEM framework search path, "
+           "absolute paths are relative to -isysroot">,
+  MetaVarName<"<directory>">, Flags<[CC1Option]>;
 def imacros : JoinedOrSeparate<["-", "--"], "imacros">, Group<clang_i_Group>, Flags<[CC1Option]>,
   HelpText<"Include macros from file before parsing">, MetaVarName<"<file>">;
 def image__base : Separate<["-"], "image_base">;
index 4d828f58056e8766fc75d990474e187bc7641004..598af20864b9968bf98e343ad7a19e4ece662b71 100644 (file)
@@ -1507,6 +1507,9 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) {
                  !A->getOption().matches(OPT_iwithsysroot));
   for (const Arg *A : Args.filtered(OPT_iframework))
     Opts.AddPath(A->getValue(), frontend::System, true, true);
+  for (const Arg *A : Args.filtered(OPT_iframeworkwithsysroot))
+    Opts.AddPath(A->getValue(), frontend::System, /*IsFramework=*/true,
+                 /*IgnoreSysRoot=*/false);
 
   // Add the paths for the various language specific isystem flags.
   for (const Arg *A : Args.filtered(OPT_c_isystem))
index 6f801f2437a28e3fdd0df6cc9be77589ca2aaca7..2354553fa094502dfe29d5f4a268c2cb847de27f 100644 (file)
@@ -1,4 +1,5 @@
 // RUN: %clang -fsyntax-only -iframework %S/Inputs %s -Xclang -verify
+// RUN: %clang -fsyntax-only -isysroot %S -iframeworkwithsysroot /Inputs %s -Xclang -verify
 // expected-no-diagnostics
 
 #include <TestFramework/TestFramework.h>