]> granicus.if.org Git - clang/commitdiff
Frontend: Support -iframework.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 18 Oct 2011 20:40:38 +0000 (20:40 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 18 Oct 2011 20:40:38 +0000 (20:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142418 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/CC1Options.td
include/clang/Driver/Options.td
lib/Driver/Tools.cpp
lib/Frontend/CompilerInvocation.cpp
test/Frontend/Inputs/TestFramework.framework/Headers/TestFramework.h [new file with mode: 0644]
test/Frontend/iframework.c [new file with mode: 0644]

index 0599e05fc73f4e2af1f725507a05f20a4af44c81..710072510954c801c0456f540d45df2426d94f7e 100644 (file)
@@ -639,6 +639,8 @@ def objc_isystem : JoinedOrSeparate<"-objc-isystem">,
 def objcxx_isystem : JoinedOrSeparate<"-objcxx-isystem">,
   MetaVarName<"<directory>">,
   HelpText<"Add directory to the ObjC++ SYSTEM include search path">;
+def iframework : JoinedOrSeparate<"-iframework">, MetaVarName<"<directory>">,
+  HelpText<"Add directory to SYSTEM framework search path">;
 def isystem : JoinedOrSeparate<"-isystem">, MetaVarName<"<directory>">,
   HelpText<"Add directory to SYSTEM include search path">;
 def iwithsysroot : JoinedOrSeparate<"-iwithsysroot">,MetaVarName<"<directory>">,
index c8295ea63d28193c6a42a5d95d96f2e88db6889e..813509705cc02b9f382ae3cc82fe2158ec4dc708 100644 (file)
@@ -517,7 +517,7 @@ def g_Joined : Joined<"-g">, Group<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<clang_i_Group>;
-def iframework : JoinedOrSeparate<"-iframework">, Group<clang_i_Group>;
+def iframework : Joined<"-iframework">, Group<clang_i_Group>;
 def imacros : JoinedOrSeparate<"-imacros">, Group<clang_i_Group>;
 def image__base : Separate<"-image_base">;
 def include_ : JoinedOrSeparate<"-include">, Group<clang_i_Group>, EnumName<"include">;
index 3a6d737dec2216581904ba05722546a4287b8d76..2dcb61bfb2437f5e11c5f3f60fc1237dab2fe7ae 100644 (file)
@@ -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) {
index 6a7d2ac10d44f30168ad7e5a16a673f6c00f12f3..05d2e692e5553a27821e04fa9d0f54a02cba52d9 100644 (file)
@@ -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 (file)
index 0000000..49048ca
--- /dev/null
@@ -0,0 +1 @@
+static int f0(void) {}
diff --git a/test/Frontend/iframework.c b/test/Frontend/iframework.c
new file mode 100644 (file)
index 0000000..0c241fd
--- /dev/null
@@ -0,0 +1,3 @@
+// RUN: %clang -fsyntax-only -iframework%S/Inputs %s -Xclang -verify
+
+#include <TestFramework/TestFramework.h>