[cfe-commits] r64466 - in /cfe/trunk/tools/ccc/ccclib: Driver.py Types.py

Daniel Dunbar daniel at zuster.org
Fri Feb 13 09:42:34 PST 2009


Author: ddunbar
Date: Fri Feb 13 11:42:34 2009
New Revision: 64466

URL: http://llvm.org/viewvc/llvm-project?rev=64466&view=rev
Log:
ccc: Suffix for PCH files is appended, not replaced.

Modified:
    cfe/trunk/tools/ccc/ccclib/Driver.py
    cfe/trunk/tools/ccc/ccclib/Types.py

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

==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Driver.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Driver.py Fri Feb 13 11:42:34 2009
@@ -802,10 +802,13 @@
             if phase.type is Types.ImageType:
                 namedOutput = "a.out"
             else:
-                inputName = args.getValue(baseInput)
-                base,_ = os.path.splitext(inputName)
                 assert phase.type.tempSuffix is not None
-                namedOutput = base + '.' + phase.type.tempSuffix
+                inputName = args.getValue(baseInput)
+                if phase.type.appendSuffix:
+                    namedOutput = inputName + '.' + phase.type.tempSuffix
+                else:
+                    base,_ = os.path.splitext(inputName)
+                    namedOutput = base + '.' + phase.type.tempSuffix
 
             # Output to user requested destination?
             if atTopLevel and finalOutput:

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

==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Types.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Types.py Fri Feb 13 11:42:34 2009
@@ -4,7 +4,7 @@
     
     def __init__(self, name, preprocess=None, onlyAssemble=False, 
                  onlyPrecompile=False, tempSuffix=None, 
-                 canBeUserSpecified=False):
+                 canBeUserSpecified=False, appendSuffix=False):
         assert preprocess is None or isinstance(preprocess, InputType)
         self.name = name
         self.preprocess = preprocess
@@ -12,6 +12,7 @@
         self.onlyPrecompile = onlyPrecompile
         self.tempSuffix = tempSuffix
         self.canBeUserSpecified = canBeUserSpecified
+        self.appendSuffix = appendSuffix
 
     def __repr__(self):
         return '%s(%r, %r, %r, %r, %r, %r)' % (self.__class__.__name__,
@@ -72,7 +73,7 @@
 LLVMAsmType = InputType('llvm-asm', tempSuffix='ll')
 LLVMBCType = InputType('llvm-bc', tempSuffix='bc')
 PlistType = InputType('plist', tempSuffix='plist')
-PCHType = InputType('precompiled-header', tempSuffix='gch')
+PCHType = InputType('precompiled-header', tempSuffix='gch', appendSuffix=True)
 ObjectType = InputType('object', tempSuffix='o')
 TreelangType = InputType('treelang', canBeUserSpecified=True)
 ImageType = InputType('image', tempSuffix='out')





More information about the cfe-commits mailing list