[cfe-commits] r62070 - in /cfe/trunk/tools/ccc/ccclib: Arguments.py Tools.py

Daniel Dunbar daniel at zuster.org
Sun Jan 11 18:24:21 PST 2009


Author: ddunbar
Date: Sun Jan 11 20:24:21 2009
New Revision: 62070

URL: http://llvm.org/viewvc/llvm-project?rev=62070&view=rev
Log:
ccc: (Darwin) Pass -ObjC to linker if -ObjC, -ObjC++ or -fobjc is
present.

Modified:
    cfe/trunk/tools/ccc/ccclib/Arguments.py
    cfe/trunk/tools/ccc/ccclib/Tools.py

Modified: cfe/trunk/tools/ccc/ccclib/Arguments.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Arguments.py?rev=62070&r1=62069&r2=62070&view=diff

==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Arguments.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Arguments.py Sun Jan 11 20:24:21 2009
@@ -370,10 +370,8 @@
         self.oOption = self.addOption(JoinedOrSeparateOption('-o'))
         self.xOption = self.addOption(JoinedOrSeparateOption('-x'))
 
-        # FIXME: What do these actually do? The documentation is less than
-        # clear.
-        self.addOption(FlagOption('-ObjC'))
-        self.addOption(FlagOption('-ObjC++'))
+        self.ObjCOption = self.addOption(FlagOption('-ObjC'))
+        self.ObjCXXOption = self.addOption(FlagOption('-ObjC++'))
 
         # FIXME: Weird, gcc claims this here in help but I'm not sure why;
         # perhaps interaction with preprocessor? Investigate.
@@ -559,6 +557,7 @@
         self.addOption(JoinedOption('-g'))
 
         self.f_exceptionsOption = self.addOption(FlagOption('-fexceptions'))
+        self.f_objcOption = self.addOption(FlagOption('-fobjc'))
         self.f_openmpOption = self.addOption(FlagOption('-fopenmp'))
         self.f_gnuRuntimeOption = self.addOption(FlagOption('-fgnu-runtime'))
         self.f_nestedFunctionsOption = self.addOption(FlagOption('-fnested-functions'))

Modified: cfe/trunk/tools/ccc/ccclib/Tools.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Tools.py?rev=62070&r1=62069&r2=62070&view=diff

==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Tools.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Tools.py Sun Jan 11 20:24:21 2009
@@ -359,7 +359,8 @@
         assert outputType is Types.ImageType
 
         # The logic here is derived from gcc's behavior; most of which
-        # comes from specs (link_command). Consult gcc for more information.
+        # comes from specs (starting with link_command). Consult gcc
+        # for more information.
 
         # FIXME: gcc's spec controls when this is done; certain things
         # like -filelist or -Wl, still trigger a link stage. I don't
@@ -371,9 +372,13 @@
         # Not sure why this particular decomposition exists in gcc.
         self.addLinkArgs(cmd_args, arch, arglist)
         
-        # FIXME: Need to insert "additional linker options accumulated
-        # from compilation". What does this mean precisely? And where
-        # do -Wl, options and -Xlinker options come in?
+        # This toolchain never accumlates options in specs, the only
+        # place this gets used is to add -ObjC.
+        if (arglist.getLastArg(arglist.parser.ObjCOption) or
+            arglist.getLastArg(arglist.parser.f_objcOption)):
+            cmd_args.append('-ObjC')
+        if arglist.getLastArg(arglist.parser.ObjCXXOption):
+            cmd_args.append('-ObjC')        
 
         # FIXME: gcc has %{x} in here. How could this ever happen?
         # Cruft?





More information about the cfe-commits mailing list