[cfe-commits] r65069 - /cfe/trunk/tools/ccc/ccclib/Tools.py

Daniel Dunbar daniel at zuster.org
Thu Feb 19 14:01:24 PST 2009


Author: ddunbar
Date: Thu Feb 19 16:01:23 2009
New Revision: 65069

URL: http://llvm.org/viewvc/llvm-project?rev=65069&view=rev
Log:
ccc: Also look for .gch files when seeing if we should auto load a
token-cache for clang.

Modified:
    cfe/trunk/tools/ccc/ccclib/Tools.py

Modified: cfe/trunk/tools/ccc/ccclib/Tools.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Tools.py?rev=65069&r1=65068&r2=65069&view=diff

==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Tools.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Tools.py Thu Feb 19 16:01:23 2009
@@ -321,12 +321,17 @@
         # 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)
 





More information about the cfe-commits mailing list