[PATCH] -iframework option should be forwarded to linker

Steven Wu stevenwu at apple.com
Wed Jan 21 12:50:37 PST 2015


- Format fix

  The extra braces are bad so I get rid of them. The range loop doesn't make thing better because of the long variable names. I happily switch to auto but keep my original loop structure.


http://reviews.llvm.org/D7106

Files:
  lib/Driver/Tools.cpp
  test/Driver/darwin-ld.c

Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -5964,6 +5964,12 @@
   Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
   Args.AddAllArgs(CmdArgs, options::OPT_F);
 
+  // -iframework should be forwarded as -F.
+  for (auto it = Args.filtered_begin(options::OPT_iframework),
+         ie = Args.filtered_end(); it != ie; ++it)
+    CmdArgs.push_back(Args.MakeArgString(std::string("-F") +
+                                         (*it)->getValue()));
+
   const char *Exec =
     Args.MakeArgString(getToolChain().GetLinkerPath());
   std::unique_ptr<Command> Cmd =
Index: test/Driver/darwin-ld.c
===================================================================
--- test/Driver/darwin-ld.c
+++ test/Driver/darwin-ld.c
@@ -204,3 +204,9 @@
 // RUN: FileCheck -check-prefix=LINK_IOS_SIMULATOR_VERSION_MIN %s < %t.log
 // LINK_IPHONEOS_VERSION_MIN: -iphoneos_version_min
 // LINK_IOS_SIMULATOR_VERSION_MIN: -ios_simulator_version_min
+
+// Check -iframework gets forward to ld as -F
+// RUN: %clang -target x86_64-apple-darwin %s -iframework Bar -framework Foo -### 2>&1 | \
+// RUN:   FileCheck --check-prefix=LINK-IFRAMEWORK %s
+// LINK-IFRAMEWORK: {{ld(.exe)?"}}
+// LINK-IFRAMEWORK: "-FBar"

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7106.18548.patch
Type: text/x-patch
Size: 1296 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150121/e507590b/attachment.bin>


More information about the cfe-commits mailing list