From: Daniel Dunbar Date: Tue, 18 Oct 2011 20:40:38 +0000 (+0000) Subject: Frontend: Support -iframework. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=024f4be866d13dd2b0ec062e694a62ca84c37191;p=clang Frontend: Support -iframework. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142418 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index 0599e05fc7..7100725109 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -639,6 +639,8 @@ def objc_isystem : JoinedOrSeparate<"-objc-isystem">, def objcxx_isystem : JoinedOrSeparate<"-objcxx-isystem">, MetaVarName<"">, HelpText<"Add directory to the ObjC++ SYSTEM include search path">; +def iframework : JoinedOrSeparate<"-iframework">, MetaVarName<"">, + HelpText<"Add directory to SYSTEM framework search path">; def isystem : JoinedOrSeparate<"-isystem">, MetaVarName<"">, HelpText<"Add directory to SYSTEM include search path">; def iwithsysroot : JoinedOrSeparate<"-iwithsysroot">,MetaVarName<"">, diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index c8295ea63d..813509705c 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -517,7 +517,7 @@ def g_Joined : Joined<"-g">, Group; def headerpad__max__install__names : Joined<"-headerpad_max_install_names">; def index_header_map : Flag<"-index-header-map">; def idirafter : JoinedOrSeparate<"-idirafter">, Group; -def iframework : JoinedOrSeparate<"-iframework">, Group; +def iframework : Joined<"-iframework">, Group; def imacros : JoinedOrSeparate<"-imacros">, Group; def image__base : Separate<"-image_base">; def include_ : JoinedOrSeparate<"-include">, Group, EnumName<"include">; diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 3a6d737dec..2dcb61bfb2 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1437,10 +1437,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, types::ID InputType = Inputs[0].getType(); if (!Args.hasArg(options::OPT_fallow_unsupported)) { Arg *Unsupported; - if ((Unsupported = Args.getLastArg(options::OPT_iframework))) - D.Diag(diag::err_drv_clang_unsupported) - << Unsupported->getOption().getName(); - if (types::isCXX(InputType) && getToolChain().getTriple().isOSDarwin() && getToolChain().getTriple().getArch() == llvm::Triple::x86) { diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 6a7d2ac10d..05d2e692e5 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1450,6 +1450,10 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) { OPT_iwithsysroot), ie = Args.filtered_end(); it != ie; ++it) Opts.AddPath((*it)->getValue(Args), frontend::System, true, false, !(*it)->getOption().matches(OPT_iwithsysroot)); + for (arg_iterator it = Args.filtered_begin(OPT_iframework), + ie = Args.filtered_end(); it != ie; ++it) + Opts.AddPath((*it)->getValue(Args), frontend::System, true, true, + true); // Add the paths for the various language specific isystem flags. for (arg_iterator it = Args.filtered_begin(OPT_c_isystem), diff --git a/test/Frontend/Inputs/TestFramework.framework/Headers/TestFramework.h b/test/Frontend/Inputs/TestFramework.framework/Headers/TestFramework.h new file mode 100644 index 0000000000..49048ca452 --- /dev/null +++ b/test/Frontend/Inputs/TestFramework.framework/Headers/TestFramework.h @@ -0,0 +1 @@ +static int f0(void) {} diff --git a/test/Frontend/iframework.c b/test/Frontend/iframework.c new file mode 100644 index 0000000000..0c241fd489 --- /dev/null +++ b/test/Frontend/iframework.c @@ -0,0 +1,3 @@ +// RUN: %clang -fsyntax-only -iframework%S/Inputs %s -Xclang -verify + +#include