[cfe-commits] r63277 - in /cfe/trunk/tools/ccc/ccclib: ToolChain.py Tools.py
Daniel Dunbar
daniel at zuster.org
Wed Jan 28 22:12:22 PST 2009
Author: ddunbar
Date: Thu Jan 29 00:12:22 2009
New Revision: 63277
URL: http://llvm.org/viewvc/llvm-project?rev=63277&view=rev
Log:
ccc: Honor -ccc-clang for generic GCC toolchain.
Modified:
cfe/trunk/tools/ccc/ccclib/ToolChain.py
cfe/trunk/tools/ccc/ccclib/Tools.py
Modified: cfe/trunk/tools/ccc/ccclib/ToolChain.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/ToolChain.py?rev=63277&r1=63276&r2=63277&view=diff
==============================================================================
--- cfe/trunk/tools/ccc/ccclib/ToolChain.py (original)
+++ cfe/trunk/tools/ccc/ccclib/ToolChain.py Thu Jan 29 00:12:22 2009
@@ -205,9 +205,10 @@
def __init__(self, driver):
super(Generic_GCC_ToolChain, self).__init__(driver)
cc = Tools.GCC_CompileTool()
+ self.clangTool = Tools.Clang_CompileTool(self)
self.toolMap = {
Phases.PreprocessPhase : Tools.GCC_PreprocessTool(),
- Phases.AnalyzePhase : Tools.Clang_CompileTool(self),
+ Phases.AnalyzePhase : self.clangTool,
Phases.SyntaxOnlyPhase : cc,
Phases.EmitLLVMPhase : cc,
Phases.CompilePhase : cc,
@@ -218,4 +219,18 @@
def selectTool(self, action):
assert isinstance(action, Phases.JobAction)
+
+ if self.driver.cccClang:
+ if (action.inputs[0].type in (Types.CType, Types.CTypeNoPP,
+ Types.ObjCType, Types.ObjCTypeNoPP) and
+ (isinstance(action.phase, Phases.PreprocessPhase) or
+ isinstance(action.phase, Phases.CompilePhase) or
+ isinstance(action.phase, Phases.SyntaxOnlyPhase) or
+ isinstance(action.phase, Phases.EmitLLVMPhase))):
+ return self.clangTool
+ elif (action.inputs[0].type in (Types.CHeaderType, Types.CHeaderNoPPType,
+ Types.ObjCHeaderType, Types.ObjCHeaderNoPPType) and
+ isinstance(action.phase, Phases.PrecompilePhase)):
+ return self.clangTool
+
return self.toolMap[action.phase.__class__]
Modified: cfe/trunk/tools/ccc/ccclib/Tools.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Tools.py?rev=63277&r1=63276&r2=63277&view=diff
==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Tools.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Tools.py Thu Jan 29 00:12:22 2009
@@ -247,12 +247,14 @@
not arglist.getLastArg(arglist.parser.staticOption) and
not arglist.getLastArg(arglist.parser.m_dynamicNoPicOption)))
- archName = arglist.getValue(arch)
- if (archName == 'x86_64' or
- picEnabled):
- cmd_args.append('--relocation-model=pic')
- elif not arglist.getLastArg(arglist.parser.m_dynamicNoPicOption):
- cmd_args.append('--relocation-model=static')
+ # FIXME: This needs to tie into a platform hook.
+ if arch:
+ archName = arglist.getValue(arch)
+ if (archName == 'x86_64' or
+ picEnabled):
+ cmd_args.append('--relocation-model=pic')
+ elif not arglist.getLastArg(arglist.parser.m_dynamicNoPicOption):
+ cmd_args.append('--relocation-model=static')
if arglist.getLastArg(arglist.parser.f_timeReportOption):
cmd_args.append('--time-passes')
More information about the cfe-commits
mailing list