]> granicus.if.org Git - clang/commitdiff
ccc: Suffix for PCH files is appended, not replaced.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 13 Feb 2009 17:42:34 +0000 (17:42 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 13 Feb 2009 17:42:34 +0000 (17:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64466 91177308-0d34-0410-b5e6-96231b3b80d8

tools/ccc/ccclib/Driver.py
tools/ccc/ccclib/Types.py

index cda016153e894ccd20258f8bb2960eb07da3e17e..43e145b9dbe5e635e15be531930acef9107d8c44 100644 (file)
@@ -802,10 +802,13 @@ class Driver(object):
             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:
index 1dd3ed90118bff36ac166dbc46df8ba6e9f75c78..94c00410da6e7850a253690997d3dd5185524d6d 100644 (file)
@@ -4,7 +4,7 @@ class InputType(object):
     
     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 @@ class InputType(object):
         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 @@ JavaType = InputType('java', canBeUserSpecified=True)
 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')