Commit Graph

17 Commits

Author SHA1 Message Date
Daniel Dunbar 95953ce31c Driver: Make argument parsing fast.
On a synthetic command line consisting of almost all defined options,
this drops wall time from .00494 to .00336 and user time from .00258
to .00105.

On the same benchmark, clang-driver is about 15% faster than the
primary gcc driver and almost twice as fast as the gcc driver driver.

llvm-svn: 67564
2009-03-23 21:50:40 +00:00
Daniel Dunbar ee4d1feb44 Driver: Fix off by one in computation of first searchable option.
llvm-svn: 67552
2009-03-23 19:19:19 +00:00
Daniel Dunbar 453d79a2db Driver: Check that options are ordered properly (outside of
Release-Asserts mode).

Also, avoid searching through option groups (which will never match).

llvm-svn: 67548
2009-03-23 18:41:45 +00:00
Daniel Dunbar d8500f3b0f Driver: Implement 'missing argument' error.
llvm-svn: 67490
2009-03-22 23:26:43 +00:00
Daniel Dunbar 4b6058e33a Driver: Add "d" flag to Options.def for options which are completely
handled by driver. 
 - This is not very precise, we use it to drive the "forward-to-gcc"
   predicate, when trying to talk to a generic gcc tool.

 - Slightly better than what ccc was doing, and should be good
   enough. Platforms which want a robust driver should implement a
   proper tool chain.

llvm-svn: 67181
2009-03-18 08:01:15 +00:00
Daniel Dunbar 92c2af76c4 Driver: Value initialization is nicer than memset.
- Who wouldn't want correctness to hang critically on two easily
   ignored characters?

Thanks Doug!

llvm-svn: 66819
2009-03-12 18:42:02 +00:00
Daniel Dunbar 57fc0194a8 Driver: Drop some unnecessary uses of clang namespace.
llvm-svn: 66813
2009-03-12 18:31:08 +00:00
Daniel Dunbar d971762d5a Driver: '-' is parsed as an input.
llvm-svn: 66784
2009-03-12 08:44:47 +00:00
Daniel Dunbar 6d3d46bbeb Driver: Add Option flags.
llvm-svn: 66774
2009-03-12 05:46:32 +00:00
Daniel Dunbar c727e9310d Driver: Tweak option naming/def:
- Use OPT_ prefix for ids.

 - Reference groups and aliases by shortend id (on the theory that
   this is more readable).

 - Rename the special option ids to more protected names.

llvm-svn: 66767
2009-03-12 03:42:54 +00:00
Daniel Dunbar 71dc375142 Driver: Reorder arguments in Options.def so option name is first.
llvm-svn: 66759
2009-03-12 01:46:53 +00:00
Daniel Dunbar 458b6982d4 Driver: Implement Option::accept methods.
llvm-svn: 66106
2009-03-04 23:22:02 +00:00
Daniel Dunbar b7396f10b9 Driver: Fix off by one in ParseOneArg; this code is ugly but will be
replaced anyway.

llvm-svn: 66101
2009-03-04 23:03:35 +00:00
Daniel Dunbar d9621da5ae Driver: Add OptTable::ParseOneArg.
llvm-svn: 66090
2009-03-04 22:41:37 +00:00
Daniel Dunbar a59194cd10 Driver: Option's need to know their ID.
- Also, add Input and Unknown opts to OptTable.

llvm-svn: 66079
2009-03-04 21:53:04 +00:00
Daniel Dunbar f49bc318ed Driver: Add Option flags.
llvm-svn: 66067
2009-03-04 21:05:23 +00:00
Daniel Dunbar 5637208a88 Driver: More Option implementation.
- Add Options.def file, collects option information.

 - Actual option instantiation is handled lazily by OptTable to allow
   the driver to not need to instantiate all options.

 - cast<> support for Option, other minor tweaks.

llvm-svn: 66028
2009-03-04 08:33:23 +00:00