diff options
-rw-r--r-- | tools/ccc/ccclib/Driver.py | 5 | ||||
-rw-r--r-- | tools/ccc/ccclib/Tools.py | 24 |
2 files changed, 22 insertions, 7 deletions
diff --git a/tools/ccc/ccclib/Driver.py b/tools/ccc/ccclib/Driver.py index 46b4541fc4..75f48da886 100644 --- a/tools/ccc/ccclib/Driver.py +++ b/tools/ccc/ccclib/Driver.py @@ -573,7 +573,7 @@ class Driver(object): 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 @@ class Driver(object): 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): diff --git a/tools/ccc/ccclib/Tools.py b/tools/ccc/ccclib/Tools.py index 57c8afc6bb..1140dee6b4 100644 --- a/tools/ccc/ccclib/Tools.py +++ b/tools/ccc/ccclib/Tools.py @@ -115,8 +115,10 @@ class Darwin_AssembleTool(Tool): 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 @@ class Darwin_X86_CompileTool(Tool): #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 @@ class Darwin_X86_CompileTool(Tool): 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)) |