[cfe-commits] r62831 - in /cfe/trunk/tools/ccc/ccclib: Arguments.py Driver.py Tools.py
Daniel Dunbar
daniel at zuster.org
Thu Jan 22 18:00:46 PST 2009
Author: ddunbar
Date: Thu Jan 22 20:00:46 2009
New Revision: 62831
URL: http://llvm.org/viewvc/llvm-project?rev=62831&view=rev
Log:
ccc: Support long ('--...') flag arguments.
- Curiously, a number of the current translations gcc does appear to
be useless?
Modified:
cfe/trunk/tools/ccc/ccclib/Arguments.py
cfe/trunk/tools/ccc/ccclib/Driver.py
cfe/trunk/tools/ccc/ccclib/Tools.py
Modified: cfe/trunk/tools/ccc/ccclib/Arguments.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Arguments.py?rev=62831&r1=62830&r2=62831&view=diff
==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Arguments.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Arguments.py Thu Jan 22 20:00:46 2009
@@ -498,7 +498,7 @@
self.archOption = self.addOption(SeparateOption('-arch'))
# Misc driver options
- self.addOption(FlagOption('-pass-exit-codes'))
+ self.passExitCodesOption = self.addOption(FlagOption('-pass-exit-codes'))
self.dumpspecsOption = self.addOption(FlagOption('-dumpspecs'))
self.dumpversionOption = self.addOption(FlagOption('-dumpversion'))
self.dumpmachineOption = self.addOption(FlagOption('-dumpmachine'))
@@ -507,8 +507,8 @@
self.printFileNameOption = self.addOption(JoinedOption('-print-file-name='))
self.printProgNameOption = self.addOption(JoinedOption('-print-prog-name='))
self.printMultiDirectoryOption = self.addOption(FlagOption('-print-multi-directory'))
+ self.printMultiOsDirectoryOption = self.addOption(FlagOption('-print-multi-os-directory'))
self.printMultiLibOption = self.addOption(FlagOption('-print-multi-lib'))
- self.addOption(FlagOption('-print-multi-os-directory'))
# Pipeline control
self.hashHashHashOption = self.addOption(FlagOption('-###'))
@@ -618,7 +618,7 @@
self.preloadOption = self.addOption(FlagOption('-preload'))
self.staticOption = self.addOption(FlagOption('-static'))
self.pagezero_sizeOption = self.addOption(FlagOption('-pagezero_size'))
- self.addOption(FlagOption('-shared'))
+ self.sharedOption = self.addOption(FlagOption('-shared'))
self.staticLibgccOption = self.addOption(FlagOption('-static-libgcc'))
self.sharedLibgccOption = self.addOption(FlagOption('-shared-libgcc'))
self.COption = self.addOption(FlagOption('-C'))
@@ -701,7 +701,11 @@
self.AOption = self.addOption(JoinedOrSeparateOption('-A'))
self.DOption = self.addOption(JoinedOrSeparateOption('-D'))
self.FOption = self.addOption(JoinedOrSeparateOption('-F'))
- self.IOption = self.addOption(JoinedOrSeparateOption('-I'))
+
+ self.IGroup = OptionGroup('-I')
+ self.I_Option = self.addOption(FlagOption('-I-', self.IGroup))
+ self.addOption(JoinedOrSeparateOption('-I', self.IGroup))
+
self.LOption = self.addOption(JoinedOrSeparateOption('-L'))
self.TOption = self.addOption(JoinedOrSeparateOption('-T'))
self.UOption = self.addOption(JoinedOrSeparateOption('-U'))
@@ -872,6 +876,8 @@
# Long option handling (aliases).
self.addOption(FlagOption('--help'))
self.addOption(FlagOption('--target-help'))
+ # FIXME: Who handles this?
+ self.addOption(FlagOption('--version'))
self.addOption(FlagOption('--all-warnings', alias=self.WallOption))
self.addOption(FlagOption('--ansi', alias=self.ansiOption))
@@ -882,17 +888,58 @@
self.addOption(JoinedOption('--classpath=', alias=self.f_classpathOption))
self.addOption(SeparateOption('--classpath', alias=self.f_classpathOption,
forceJoinedRender=True))
+ self.addOption(FlagOption('--combine', alias=self.combineOption))
+ self.addOption(FlagOption('--comments', alias=self.COption))
+ self.addOption(FlagOption('--comments-in-macros', alias=self.CCOption))
+ self.addOption(FlagOption('--compile', alias=self.cOption))
self.addOption(FlagOption('--coverage', alias=self.coverageOption))
+ self.addOption(FlagOption('--dependencies', alias=self.MOption))
+ self.addOption(FlagOption('--entry', alias=self.eOption))
+ self.addOption(FlagOption('--extra-warnings', alias=self.WOption))
+ self.addOption(FlagOption('--coverage', alias=self.coverageOption))
+ self.addOption(FlagOption('--include-barrier', alias=self.I_Option))
+ self.addOption(FlagOption('--no-integrated-cpp', alias=self.noIntegratedCPPOption))
+ self.addOption(FlagOption('--no-line-commands', alias=self.POption))
+# self.addOption(FlagOption('--no-precompiled-includes', alias=self.noprecompOption))
+ self.addOption(FlagOption('--no-standard-includes', alias=self.nostdincOption))
+ self.addOption(FlagOption('--no-standard-libraries', alias=self.nostdlibOption))
+ self.addOption(FlagOption('--no-warnings', alias=self.wOption))
+ self.addOption(FlagOption('--pass-exit-codes', alias=self.passExitCodesOption))
+ self.addOption(FlagOption('--pedantic', alias=self.pedanticOption))
+ self.addOption(FlagOption('--pedantic-errors', alias=self.pedanticErrorsOption))
+# self.addOption(FlagOption('--pie', alias=self.pieOption))
+ self.addOption(FlagOption('--pipe', alias=self.pipeOption))
+ self.addOption(FlagOption('--preprocess', alias=self.EOption))
self.addOption(JoinedOption('--param=', alias=self._paramOption,
forceSeparateRender=True))
- self.addOption(FlagOption('--print-libgcc-file-name',
- alias=self.printLibgccFileNameOption))
self.addOption(JoinedOption('--print-file-name=', alias=self.printFileNameOption))
self.addOption(SeparateOption('--print-file-name', alias=self.printFileNameOption))
+ self.addOption(FlagOption('--print-libgcc-file-name',
+ alias=self.printLibgccFileNameOption))
+ self.addOption(FlagOption('--print-missing-file-dependencies', alias=self.MGOption))
+ self.addOption(FlagOption('--print-multi-lib', alias=self.printMultiLibOption))
+ self.addOption(FlagOption('--print-multi-directory', alias=self.printMultiDirectoryOption))
+ self.addOption(FlagOption('--print-multi-os-directory', alias=self.printMultiOsDirectoryOption))
self.addOption(JoinedOption('--print-prog-name=', alias=self.printProgNameOption))
self.addOption(SeparateOption('--print-prog-name', alias=self.printProgNameOption))
- self.addOption(FlagOption('--version', alias=self.vOption))
+ self.addOption(FlagOption('--print-search-dirs', alias=self.printSearchDirsOption))
+ self.addOption(FlagOption('--profile', alias=self.pOption))
+ self.addOption(FlagOption('--profile-blocks', alias=self.aOption))
+# self.addOption(FlagOption('--quiet', alias=self.qOption))
+# self.addOption(FlagOption('--shared', alias=self.sharedOption))
+# self.addOption(FlagOption('--silent', alias=self.qOption))
+ self.addOption(FlagOption('--static', alias=self.staticOption))
+# self.addOption(FlagOption('--symbolic', alias=self.symbolicOption))
+# self.addOption(FlagOption('--time', alias=self.timeOption))
+ self.addOption(FlagOption('--trace-includes', alias=self.HOption))
+ self.addOption(FlagOption('--traditional', alias=self.traditionalOption))
+ self.addOption(FlagOption('--traditional-cpp', alias=self.traditionalCPPOption))
+ self.addOption(FlagOption('--trigraphs', alias=self.trigraphsOption))
+ self.addOption(FlagOption('--user-dependencies', alias=self.MMOption))
+ self.addOption(FlagOption('--verbose', alias=self.vOption))
self.addOption(FlagOption('--save-temps', alias=self.saveTempsOption))
+ self.addOption(FlagOption('--write-dependencies', alias=self.MDOption))
+ self.addOption(FlagOption('--write-user-dependencies', alias=self.MMDOption))
def addOption(self, opt):
self.options.append(opt)
Modified: cfe/trunk/tools/ccc/ccclib/Driver.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Driver.py?rev=62831&r1=62830&r2=62831&view=diff
==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Driver.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Driver.py Thu Jan 22 20:00:46 2009
@@ -313,6 +313,7 @@
arg = (args.getLastArg(self.parser.dumpspecsOption) or
args.getLastArg(self.parser.printMultiDirectoryOption) or
+ args.getLastArg(self.parser.printMultiOsDirectoryOption) or
args.getLastArg(self.parser.printMultiLibOption))
if arg:
raise Arguments.InvalidArgumentsError('%s unsupported by this driver' % arg.opt.name)
Modified: cfe/trunk/tools/ccc/ccclib/Tools.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Tools.py?rev=62831&r1=62830&r2=62831&view=diff
==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Tools.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Tools.py Thu Jan 22 20:00:46 2009
@@ -274,7 +274,7 @@
arglist.addAllArgs(cmd_args, arglist.parser.vOption)
arglist.addAllArgs2(cmd_args, arglist.parser.DOption, arglist.parser.UOption)
- arglist.addAllArgs2(cmd_args, arglist.parser.IOption, arglist.parser.FOption)
+ arglist.addAllArgs2(cmd_args, arglist.parser.IGroup, arglist.parser.FOption)
arglist.addAllArgs(cmd_args, arglist.parser.m_macosxVersionMinOption)
# Special case debug options to only pass -g to clang. This is
@@ -545,7 +545,7 @@
cmd_args.append('-quiet')
arglist.addAllArgs(cmd_args, arglist.parser.nostdincOption)
arglist.addLastArg(cmd_args, arglist.parser.vOption)
- arglist.addAllArgs2(cmd_args, arglist.parser.IOption, arglist.parser.FOption)
+ arglist.addAllArgs2(cmd_args, arglist.parser.IGroup, arglist.parser.FOption)
arglist.addLastArg(cmd_args, arglist.parser.POption)
# FIXME: Handle %I properly.
More information about the cfe-commits
mailing list