Commit Graph

23 Commits

Author SHA1 Message Date
Daniel Dunbar b2a7c062aa Driver: Fix a parsing bug where some options were matched
incorrectly. I'm blanking on the smartest way to write this search,
but we should just do the right thing when we move to TableGen.
 - <rdar://problem/6761194> [driver] -Wextra-tokens isn't parsed
   correctly

llvm-svn: 68525
2009-04-07 18:21:47 +00:00
Daniel Dunbar 77684ead4b Driver: Add OptTable::getOptionKind.
Also, removed default value for getOptionMetaVar.

llvm-svn: 68146
2009-03-31 21:26:12 +00:00
Daniel Dunbar a207254f94 Driver: Add extra parameters for help text to option definitions.
- Currently unused.

And yes, now may be about the time I want a TableGen backend.

llvm-svn: 68139
2009-03-31 20:12:05 +00:00
Daniel Dunbar 0e378b1e26 Driver: Replace Option::ForwardToGCC by Option::DriverOption (which
matches the flag in Options.def).

llvm-svn: 67679
2009-03-25 06:08:46 +00:00
Daniel Dunbar dac54a81df Driver: Prep for tool chain specific argument translation.
- Lift ArgList to a base class for InputArgList and DerivedArgList.
 
 - This is not a great decomposition, but it does embed the
   translation into the type system, and keep things efficient for
   tool chains that don't want to do any translation.

 - No intended functionality change.

Eventually I hope to get rid of tool chain specific translation and
have each tool do the right thing, but for now this is the easiest way
to match gcc precisely (which is good for testing).

llvm-svn: 67676
2009-03-25 04:13:45 +00:00
Daniel Dunbar 0e0cf39a9e gcc 4.3 finds my use of ^ suspicious.
llvm-svn: 67673
2009-03-25 03:06:26 +00:00
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