[cfe-commits] r62213 - /cfe/trunk/tools/ccc/ccclib/Tools.py

Daniel Dunbar daniel at zuster.org
Tue Jan 13 19:31:16 PST 2009


Author: ddunbar
Date: Tue Jan 13 21:31:16 2009
New Revision: 62213

URL: http://llvm.org/viewvc/llvm-project?rev=62213&view=rev
Log:
ccc: Darwin/Compiler: Improve gcc compat in use of -auxbase-strip.

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

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

==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Tools.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Tools.py Tue Jan 13 21:31:16 2009
@@ -459,16 +459,16 @@
 
         # FIXME: The goal is to use the user provided -o if that is
         # our final output, otherwise to drive from the original input
-        # name.
-        #
-        # This implementation is close, but gcc also does this for -S
-        # which is broken, and it would be nice to find a cleaner way
-        # which doesn't introduce a dependency on the output argument
-        # we are given.
-        outputOpt = arglist.getLastArg(arglist.parser.oOption)
-        if outputOpt and outputOpt is output:
-            cmd_args.append('-auxbase-strip')
-            cmd_args.append(arglist.getValue(outputOpt))
+        # name. Find a clean way to go about this.
+        if (arglist.getLastArg(arglist.parser.cOption) or
+            arglist.getLastArg(arglist.parser.SOption)):            
+            outputOpt = arglist.getLastArg(arglist.parser.oOption)
+            if outputOpt:
+                cmd_args.append('-auxbase-strip')
+                cmd_args.append(arglist.getValue(outputOpt))
+            else:
+                cmd_args.append('-auxbase')
+                cmd_args.append(self.getBaseInputStem(inputs, arglist))
         else:
             cmd_args.append('-auxbase')
             cmd_args.append(self.getBaseInputStem(inputs, arglist))





More information about the cfe-commits mailing list