diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-01-26 17:09:15 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-01-26 17:09:15 +0000 |
| commit | f3a06113c75348d884500b83a538e7dd82476051 (patch) | |
| tree | 68bf220b535e1cb4012c5c2addad1446b6dbb7c0 /clang/tools/ccc/ccclib/Driver.py | |
| parent | 179dd918b93b13c2eb7e9df1f05d4281c7b4250f (diff) | |
| download | bcm5719-llvm-f3a06113c75348d884500b83a538e7dd82476051.tar.gz bcm5719-llvm-f3a06113c75348d884500b83a538e7dd82476051.zip | |
ccc: Recognize -emit-llvm [-S].
- Unlike llvm-gcc, this doesn't yet treat -emit-llvm output as a
linker input.
llvm-svn: 63014
Diffstat (limited to 'clang/tools/ccc/ccclib/Driver.py')
| -rw-r--r-- | clang/tools/ccc/ccclib/Driver.py | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/clang/tools/ccc/ccclib/Driver.py b/clang/tools/ccc/ccclib/Driver.py index 9a393f183fa..0fe58068ae4 100644 --- a/clang/tools/ccc/ccclib/Driver.py +++ b/clang/tools/ccc/ccclib/Driver.py @@ -336,6 +336,7 @@ class Driver(object): def buildNormalPipeline(self, args): hasAnalyze = args.getLastArg(self.parser.analyzeOption) hasCombine = args.getLastArg(self.parser.combineOption) + hasEmitLLVM = args.getLastArg(self.parser.emitLLVMOption) hasSyntaxOnly = args.getLastArg(self.parser.syntaxOnlyOption) hasDashC = args.getLastArg(self.parser.cOption) hasDashE = args.getLastArg(self.parser.EOption) @@ -368,7 +369,7 @@ class Driver(object): # worth doing, since the tool presumably does this # anyway, and this just adds an extra stat to the # equation, but this is gcc compatible. - if not os.path.exists(inputValue): + if inputValue != '-' and not os.path.exists(inputValue): self.warning("%s: No such file or directory" % inputValue) else: inputs.append((klass, a)) @@ -408,15 +409,11 @@ class Driver(object): if hasDashE or hasDashM or hasDashMM: finalPhase = Phases.Phase.eOrderPreprocess finalPhaseOpt = hasDashE - elif hasAnalyze: + elif (hasAnalyze or hasSyntaxOnly or + hasEmitLLVM or hasDashS): finalPhase = Phases.Phase.eOrderCompile - finalPhaseOpt = hasAnalyze - elif hasSyntaxOnly: - finalPhase = Phases.Phase.eOrderCompile - finalPhaseOpt = hasSyntaxOnly - elif hasDashS: - finalPhase = Phases.Phase.eOrderCompile - finalPhaseOpt = hasDashS + finalPhaseOpt = (hasAnalyze or hasSyntaxOnly or + hasEmitLLVM or hasDashS) elif hasDashC: finalPhase = Phases.Phase.eOrderAssemble finalPhaseOpt = hasDashC @@ -464,6 +461,8 @@ class Driver(object): sequence.append(Phases.AnalyzePhase()) elif hasSyntaxOnly: sequence.append(Phases.SyntaxOnlyPhase()) + elif hasEmitLLVM: + sequence.append(Phases.EmitLLVMPhase()) else: sequence.extend([Phases.CompilePhase(), Phases.AssemblePhase(), @@ -506,6 +505,14 @@ class Driver(object): current = Phases.JobAction(transition, [current], output) + elif isinstance(transition, Phases.EmitLLVMPhase): + if hasDashS: + output = Types.LLVMAsmType + else: + output = Types.LLVMBCType + current = Phases.JobAction(transition, + [current], + output) elif isinstance(transition, Phases.CompilePhase): output = Types.AsmTypeNoPP current = Phases.JobAction(transition, |

