aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-02-19 22:01:23 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-02-19 22:01:23 +0000
commitf084663ed01cbe382c700947908b4130fec0406a (patch)
tree072fad55f74350983953438fc6964227061af263
parente20de512d88cf42a26ef994687d87fc6f5826625 (diff)
ccc: Also look for .gch files when seeing if we should auto load a
token-cache for clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65069 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/ccc/ccclib/Tools.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/ccc/ccclib/Tools.py b/tools/ccc/ccclib/Tools.py
index e2d0e9e410..f08f1c7c40 100644
--- a/tools/ccc/ccclib/Tools.py
+++ b/tools/ccc/ccclib/Tools.py
@@ -321,12 +321,17 @@ class Clang_CompileTool(Tool):
# FIXME: Clang isn't going to accept just anything here.
arglist.addAllArgs(cmd_args, arglist.parser.iGroup)
- # Automatically load .pth files which match -include options.
+ # Automatically load .pth or .gch files which match -include
+ # options. It's wonky, but we include looking for .gch so we
+ # can support seamless replacement into a build system already
+ # set up to be generating .gch files.
for arg in arglist.getArgs(arglist.parser.includeOption):
- pthPath = arglist.getValue(arg) + '.pth'
- if os.path.exists(pthPath):
- cmd_args.append('-token-cache')
- cmd_args.append(pthPath)
+ for suffix in ('.pth','.gch'):
+ pthPath = arglist.getValue(arg) + suffix
+ if os.path.exists(pthPath):
+ cmd_args.append('-token-cache')
+ cmd_args.append(pthPath)
+ break
arglist.addAllArgs(cmd_args, arglist.parser.fblocksGroup)