]> granicus.if.org Git - clang/commitdiff
ccc: @<filename> arguments are only treated specially if <filename>
authorDaniel Dunbar <daniel@zuster.org>
Mon, 16 Feb 2009 18:18:43 +0000 (18:18 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 16 Feb 2009 18:18:43 +0000 (18:18 +0000)
exists, otherwise gcc just treats as an input.
 - PR3591

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64640 91177308-0d34-0410-b5e6-96231b3b80d8

tools/ccc/ccclib/Arguments.py

index 2e4c2064ead57eda8ec63f3b8a8014372243f786..5d20feaae1c64bc505b864c6b241671e6006a21a 100644 (file)
@@ -1,3 +1,4 @@
+import os
 
 ###
 
@@ -1114,8 +1115,13 @@ class OptionParser:
                 # still take them as arguments).
                 pass
             elif a[0] == '@':
-                # FIXME: Handle '@'
-                raise InvalidArgumentsError('@ style argument lists are unsupported')
+                # @<filename> is only an argument list if it actually
+                # exists, otherwise it is treated like an input.
+                if os.path.exists(a[1:]):
+                    # FIXME: Handle '@'
+                    raise InvalidArgumentsError('@ style argument lists are unsupported')
+                else:
+                    args.append(PositionalArg(i, self.inputOption))
             elif a[0] == '-' and a != '-':
                 args.append(self.lookupOptForArg(i, a, it))
             else: