[cfe-commits] r62152 - in /cfe/trunk/tools/ccc/ccclib: Driver.py Tools.py
Daniel Dunbar
daniel at zuster.org
Mon Jan 12 22:25:31 PST 2009
Author: ddunbar
Date: Tue Jan 13 00:25:31 2009
New Revision: 62152
URL: http://llvm.org/viewvc/llvm-project?rev=62152&view=rev
Log:
ccc: Bug fix and gcc compatibility tweak.
- --gstabs only goes to Darwin/Assembler when dealing with an
assembly file from the command line.
- Relative placement of -o option for cc1 moves depending on
-fsyntax-only/-S, how quaint.
Modified:
cfe/trunk/tools/ccc/ccclib/Driver.py
cfe/trunk/tools/ccc/ccclib/Tools.py
Modified: cfe/trunk/tools/ccc/ccclib/Driver.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Driver.py?rev=62152&r1=62151&r2=62152&view=diff
==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Driver.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Driver.py Tue Jan 13 00:25:31 2009
@@ -573,7 +573,7 @@
elif hasNoIntegratedCPP:
self.claim(hasNoIntegratedCPP)
-
+ # FIXME: Move to... somewhere else.
class InputInfo:
def __init__(self, source, type, baseInput):
self.source = source
@@ -583,6 +583,9 @@
def __repr__(self):
return '%s(%r, %r, %r)' % (self.__class__.__name__,
self.source, self.type, self.baseInput)
+
+ def isOriginalInput(self):
+ return self.source is self.baseInput
def createJobs(tc, phase, forwardArgs,
canAcceptPipe=False, atTopLevel=False, arch=None):
Modified: cfe/trunk/tools/ccc/ccclib/Tools.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Tools.py?rev=62152&r1=62151&r2=62152&view=diff
==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Tools.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Tools.py Tue Jan 13 00:25:31 2009
@@ -115,8 +115,10 @@
cmd_args = []
- if arglist.getLastArg(arglist.parser.gGroup):
- cmd_args.append('--gstabs')
+ # Bit of a hack, this is only used for original inputs.
+ if input.isOriginalInput():
+ if arglist.getLastArg(arglist.parser.gGroup):
+ cmd_args.append('--gstabs')
# Derived from asm spec.
if arch:
@@ -442,13 +444,20 @@
#arglist.addLastArg(cmd_args, arglist.parser._helpOption)
#arglist.addLastArg(cmd_args, arglist.parser._targetHelpOption)
+ # There is no need for this level of compatibility, but it
+ # makes diffing easier.
+ outputAtEnd = (not arglist.getLastArg(arglist.parser.syntaxOnlyOption) and
+ not arglist.getLastArg(arglist.parser.SOption))
if isinstance(output, Jobs.PipedJob):
- cmd_args.extend(['-o', '-'])
+ output_args = ['-o', '-']
elif output is None:
- cmd_args.extend(['-o', '/dev/null'])
+ output_args = ['-o', '/dev/null']
else:
- cmd_args.extend(arglist.render(output))
-
+ output_args = arglist.render(output)
+
+ if not outputAtEnd:
+ cmd_args.extend(output_args)
+
# FIXME: Still don't get what is happening here. Investigate.
arglist.addAllArgs(cmd_args, arglist.parser._paramOption)
@@ -461,6 +470,9 @@
cmd_args.append('-fprofile-arcs')
cmd_args.append('-ftest-coverage')
+ if outputAtEnd:
+ cmd_args.extend(output_args)
+
jobs.addJob(Jobs.Command(self.toolChain.getProgramPath(cc1Name),
cmd_args))
More information about the cfe-commits
mailing list