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.

llvm-svn: 62152
This commit is contained in:
Daniel Dunbar 2009-01-13 06:25:31 +00:00
parent 4f9c47aab9
commit fc8d8effb6
2 changed files with 22 additions and 7 deletions

View File

@ -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):

View File

@ -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))