From: Daniel Dunbar Date: Thu, 19 Feb 2009 22:01:23 +0000 (+0000) Subject: ccc: Also look for .gch files when seeing if we should auto load a X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f084663ed01cbe382c700947908b4130fec0406a;p=clang 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 --- 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)