r297614 - Add -iframeworkwithsysroot compiler option
Alex Lorenz via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 13 04:17:41 PDT 2017
Author: arphaman
Date: Mon Mar 13 06:17:41 2017
New Revision: 297614
URL: http://llvm.org/viewvc/llvm-project?rev=297614&view=rev
Log:
Add -iframeworkwithsysroot compiler option
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
Modified:
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/test/Frontend/iframework.c
Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=297614&r1=297613&r2=297614&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Mon Mar 13 06:17:41 2017
@@ -1524,6 +1524,11 @@ def idirafter : JoinedOrSeparate<["-"],
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">;
Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=297614&r1=297613&r2=297614&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Mon Mar 13 06:17:41 2017
@@ -1507,6 +1507,9 @@ static void ParseHeaderSearchArgs(Header
!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))
Modified: cfe/trunk/test/Frontend/iframework.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/iframework.c?rev=297614&r1=297613&r2=297614&view=diff
==============================================================================
--- cfe/trunk/test/Frontend/iframework.c (original)
+++ cfe/trunk/test/Frontend/iframework.c Mon Mar 13 06:17:41 2017
@@ -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>
More information about the cfe-commits
mailing list