diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-01-13 18:51:26 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-01-13 18:51:26 +0000 |
| commit | 28cffd3dbc1c0cc3f8430121977359fb79994d6d (patch) | |
| tree | df679272060790a747121dec693cb0fbb7d4acd1 /clang/tools/ccc/ccclib/Driver.py | |
| parent | bc12e920681c7bdf6def76c8f833253c4f49183a (diff) | |
| download | bcm5719-llvm-28cffd3dbc1c0cc3f8430121977359fb79994d6d.tar.gz bcm5719-llvm-28cffd3dbc1c0cc3f8430121977359fb79994d6d.zip | |
ccc: Allow internal tool chain specific argument translation.
- Pulled -Xarch processing into this.
- Get rid of manual creation of forwarding arg array.
- Use Darwin/CC1 instead of generic GCC cc1 on X86.
llvm-svn: 62172
Diffstat (limited to 'clang/tools/ccc/ccclib/Driver.py')
| -rw-r--r-- | clang/tools/ccc/ccclib/Driver.py | 55 |
1 files changed, 12 insertions, 43 deletions
diff --git a/clang/tools/ccc/ccclib/Driver.py b/clang/tools/ccc/ccclib/Driver.py index 75f48da886d..310607c1da4 100644 --- a/clang/tools/ccc/ccclib/Driver.py +++ b/clang/tools/ccc/ccclib/Driver.py @@ -538,25 +538,6 @@ class Driver(object): hasTraditionalCPP = args.getLastArg(self.parser.traditionalCPPOption) hasPipe = args.getLastArg(self.parser.pipeOption) - # FIXME: forward will die, this isn't really how things are - # done, instead everything comes from the arglist. For this we - # need a DerivedArgList for handling -Xarch, and some way to - # still figure out what to forward to the generic gcc tool. - forward = [] - for a in args: - if a.opt is self.parser.inputOption: - pass - - # FIXME: Needs to be part of option. - elif (a.opt.name in ('-E', '-S', '-c', - '-arch', '-fsyntax-only', '-combine', '-x', - '-###') or - a.opt.isLinkerInput): - pass - - else: - forward.append(a) - # We claim things here so that options for which we silently allow # override only ever claim the used option. if hasPipe: @@ -587,32 +568,20 @@ class Driver(object): def isOriginalInput(self): return self.source is self.baseInput - def createJobs(tc, phase, forwardArgs, - canAcceptPipe=False, atTopLevel=False, arch=None): + def createJobs(tc, phase, + canAcceptPipe=False, atTopLevel=False, arch=None, + tcArgs=None): if isinstance(phase, Phases.InputAction): return InputInfo(phase.filename, phase.type, phase.filename) elif isinstance(phase, Phases.BindArchAction): archName = args.getValue(phase.arch) tc = self.hostInfo.getToolChainForArch(archName) - filteredArgs = [] - for arg in forwardArgs: - if arg.opt is self.parser.archOption: - if arg is phase.arch: - filteredArgs.append(arg) - elif arg.opt is self.parser.XarchOption: - # FIXME: gcc-dd has another conditional for passing - # through, when the arch conditional array has an empty - # string. Why? - if args.getJoinedValue(arg) == archName: - # FIXME: This is wrong, we don't want a - # unknown arg we want an actual parsed - # version of this arg. - filteredArgs.append(args.makeUnknownArg(args.getSeparateValue(arg))) - else: - filteredArgs.append(arg) - - return createJobs(tc, phase.inputs[0], filteredArgs, - canAcceptPipe, atTopLevel, phase.arch) + return createJobs(tc, phase.inputs[0], + canAcceptPipe, atTopLevel, phase.arch, + tcArgs=None) + + if tcArgs is None: + tcArgs = tc.translateArgs(args, arch) assert isinstance(phase, Phases.JobAction) tool = tc.selectTool(phase) @@ -633,7 +602,7 @@ class Driver(object): # Only try to use pipes when exactly one input. canAcceptPipe = len(inputList) == 1 and tool.acceptsPipedInput() - inputs = [createJobs(tc, p, forwardArgs, canAcceptPipe, False, arch) + inputs = [createJobs(tc, p, canAcceptPipe, False, arch, tcArgs) for p in inputList] # Determine if we should output to a pipe. @@ -693,7 +662,7 @@ class Driver(object): self.parser.oOption) tool.constructJob(phase, arch, jobList, inputs, output, phase.type, - forwardArgs, args) + tcArgs) return InputInfo(output, phase.type, baseInput) @@ -704,7 +673,7 @@ class Driver(object): raise ValueError,"Cannot specify -o when generating multiple files." for phase in phases: - createJobs(self.toolChain, phase, forward, + createJobs(self.toolChain, phase, canAcceptPipe=True, atTopLevel=True) return jobs |

