diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-01-14 23:26:40 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-01-14 23:26:40 +0000 |
| commit | 87cb84e9f08db632fcbf2320ac1defa3a7093004 (patch) | |
| tree | 61fea25882a4bc11d5e564af5104b9fbacb5f42e /clang/tools/ccc/ccclib/ToolChain.py | |
| parent | 34074326449e1e6b7de77a4c9a0d78ea4b54ca64 (diff) | |
| download | bcm5719-llvm-87cb84e9f08db632fcbf2320ac1defa3a7093004.tar.gz bcm5719-llvm-87cb84e9f08db632fcbf2320ac1defa3a7093004.zip | |
ccc: Implement support clang PTH using gcc PCH style interface.
This requires some hackery, as gcc's PCH mechanism changes behavior,
whereas while PTH is simply a cache. Notably:
- Automatically cause clang to load a .pth file if we find one that
matches a command line -include argument (similar to how gcc
looks for .gch files).
- When generating precompiled headers, translate the suffix from .gch
to .pth (so we do not conflict with actual gcc PCH files).
- When generating precompiled headers, copy the input header to the
same location as the output PTH file. This is necessary because gcc
supports -include xxx.h even if xxx.h doesn't exist, but for clang
we need to actually have the contents of this file available.
llvm-svn: 62246
Diffstat (limited to 'clang/tools/ccc/ccclib/ToolChain.py')
| -rw-r--r-- | clang/tools/ccc/ccclib/ToolChain.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/clang/tools/ccc/ccclib/ToolChain.py b/clang/tools/ccc/ccclib/ToolChain.py index 083ce38e58b..85113285120 100644 --- a/clang/tools/ccc/ccclib/ToolChain.py +++ b/clang/tools/ccc/ccclib/ToolChain.py @@ -76,12 +76,15 @@ class Darwin_X86_ToolChain(ToolChain): def selectTool(self, action): assert isinstance(action, Phases.JobAction) - if (self.driver.cccClang and - self.archName == 'i386' and - action.inputs[0].type in (Types.CType, Types.CTypeNoPP, - Types.ObjCType, Types.ObjCTypeNoPP) and - isinstance(action.phase, Phases.CompilePhase)): - return self.clangTool + if self.driver.cccClang and self.archName == 'i386': + if (action.inputs[0].type in (Types.CType, Types.CTypeNoPP, + Types.ObjCType, Types.ObjCTypeNoPP) and + isinstance(action.phase, Phases.CompilePhase)): + 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__] |

