aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/OptTable.cpp
AgeCommit message (Collapse)AuthorFilesLines
2012-12-04Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth1-1/+1
uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
2012-11-09PR14303: Add a NoDriverOption flag to those options which are not accepted byRichard Smith1-6/+4
the driver (the options defined in CC1Options.td) and exclude their help from "clang --help". llvm-svn: 167638
2012-10-22[Options] Add prefixes to options.Michael J. Spencer1-10/+60
Each option has a set of prefixes. When matching an argument such as -funroll-loops. First the leading - is removed as it is a prefix. Then a lower_bound search for "funroll-loops" is done against the option table by option name. From there each option prefix + option name combination is tested against the argument. This allows us to support Microsoft style options where both / and - are valid prefixes. It also simplifies the cases we already have where options come in both - and -- forms. Almost every option for gnu-ld happens to have this form. llvm-svn: 166444
2012-10-19[Options] make Option a value type.Michael J. Spencer1-20/+23
llvm-svn: 166347
2012-10-18Revert r166223 and the subsequent commits that depend on it, r166230 & r166235.Argyrios Kyrtzidis1-15/+19
This seems to have introduced assertion hit when building compiler-rt. llvm-svn: 166245
2012-10-18[Options] make Option a value type.Michael J. Spencer1-19/+15
llvm-svn: 166223
2012-10-10Revert "[Options] make Option a value type."Eric Christopher1-15/+19
Author: Michael J. Spencer <bigcheesegs@gmail.com> Date: Wed Oct 10 21:48:26 2012 +0000 [Options] make Option a value type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165663 91177308-0d34-0410-b5e6-96231b3b80d8 This reverts commit 0464fd5e4ce2193e786e5adcab6b828f9366dae3. llvm-svn: 165667
2012-10-10[Options] make Option a value type.Michael J. Spencer1-19/+15
llvm-svn: 165663
2012-10-04Prefer StringRef::startswith to the strncmp/strlen contraption.Benjamin Kramer1-1/+2
This may be slightly more efficient and is definitely more readable. llvm-svn: 165217
2012-10-03Fix invalid reads by memcmp.Benjamin Kramer1-1/+1
Str may be smaller than Start->Name here. Use strncmp to avoid scanning past the end. Found by valgrind. llvm-svn: 165157
2012-10-03[Options] Store the owning OptTable in Option so it can construct Group and ↵Michael J. Spencer1-7/+1
Alias. llvm-svn: 165150
2012-09-25[Options] Store the option ID in OptTable::Info.Michael J. Spencer1-1/+1
llvm-svn: 164644
2012-08-21Reduce the amount of state in the Option class by relying on the data from ↵Michael J. Spencer1-27/+5
OptTable::Info. llvm-svn: 162299
2012-08-20Make Option non virtual.Michael J. Spencer1-25/+3
llvm-svn: 162231
2012-05-01Unify Options.td and CC1Options.td, in a first step towards unifying the ↵James Molloy1-0/+2
serialization logic in Frontend and Driver. Reviewed by Eric, Doug and Chandler, and here: http://llvm.org/reviews/r/7/ llvm-svn: 155916
2011-09-23More missing header inclusions from llvm_unreachable migration.David Blaikie1-0/+1
llvm-svn: 140369
2011-09-23Switch assert(0/false) llvm_unreachable.David Blaikie1-3/+3
llvm-svn: 140367
2011-07-23remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner1-3/+3
LLVM.h imports them into the clang namespace. llvm-svn: 135852
2011-04-15fix a bunch of comment typos found by codespell. Patch byChris Lattner1-2/+2
Luis Felipe Strano Moraes! llvm-svn: 129559
2010-12-31Remove stray emacs mode markers in all these files that was causing emacs toNick Lewycky1-1/+1
open them in fundamental-mode instead of c++-mode. Also twiddle whitespace for consistency in ToolChains.cpp. llvm-svn: 122646
2010-10-11Declare argv parameters as const char* const* instead of to char** to ↵Axel Naumann1-1/+2
clarify that they are not modified, and to allow for string literals as arguments. llvm-svn: 116200
2010-08-13Driver/OptParser: Add a NoForward flag to prevent forwarding certain options toDaniel Dunbar1-0/+2
GCC. - Mark -Xclang and -mlinker-version= with it for now, although I am sure there are more. llvm-svn: 111005
2010-06-16Frontend: Allow passing -cc1 level arguments to plugins. Patch by Troy ↵Daniel Dunbar1-1/+2
Straszheim! llvm-svn: 106113
2010-06-11Driver: Change OptTable::ParseArg to take any ArgList.Daniel Dunbar1-1/+1
llvm-svn: 105839
2010-06-09Driver: Eliminate Arg subclasses, which are now unnecessary.Daniel Dunbar1-2/+2
llvm-svn: 105762
2010-06-09Driver: Keep the rendering style in the option, instead of as part of the Arg.Daniel Dunbar1-2/+2
llvm-svn: 105761
2010-06-09Driver: Change Arg to just hold the values directly, instead of implicitlyDaniel Dunbar1-2/+2
deriving them from the Arg type. llvm-svn: 105760
2010-03-20Driver: Allow Render{Separate,Joined} option flags on JoinedOrSeparate ↵Daniel Dunbar1-2/+4
option types. Also, simplify/fix SeparateArg::render with forced join. llvm-svn: 99022
2009-12-04OptTable: Allow option groups to be used to define "help groups", which willDaniel Dunbar1-20/+61
collate the options inside that group. llvm-svn: 90592
2009-12-04OptParser: Add HelpHidden flag.Daniel Dunbar1-1/+5
llvm-svn: 90591
2009-12-03Add OptTable::PrintHelp.Daniel Dunbar1-0/+75
llvm-svn: 90420
2009-11-19Factor out OptTable::ParseArgs, for parsing an entire argument vector.Daniel Dunbar1-0/+35
llvm-svn: 89327
2009-11-19Driver: Take option ID for {Input,Unknown}Option, to drop dependency on ↵Daniel Dunbar1-5/+4
actual options. llvm-svn: 89312
2009-11-19Driver: Introduce OptSpecifier class for protecting access to an option id.Daniel Dunbar1-0/+4
llvm-svn: 89310
2009-11-19Driver: Split OptTable out into OptTable.{h,cpp}Daniel Dunbar1-32/+2
llvm-svn: 89283
2009-11-18Make MSVC happy.Daniel Dunbar1-12/+12
llvm-svn: 89247
2009-11-18Driver: Rework OptTable to have no dependency on the options it manages.Daniel Dunbar1-99/+67
llvm-svn: 89234
2009-11-18Driver: Switch Options.def to storing flags as a bitmask (instead of mangledDaniel Dunbar1-25/+37
into a string). llvm-svn: 89212
2009-09-09Remove tabs, and whitespace cleanups.Mike Stump1-6/+6
llvm-svn: 81346
2009-07-13Explicitly initialize the options array, MinGW's gcc 4.3.5 appears to have a bugDaniel Dunbar1-1/+5
in array value-initialization. llvm-svn: 75518
2009-04-07Driver: Add 'q' flag for options which shouldn't be reported as unused.Daniel Dunbar1-0/+1
- <rdar://problem/6756295> warning about '-dynamic' argument unused during compilation seems incorrect llvm-svn: 68535
2009-04-07Driver: Fix a parsing bug where some options were matchedDaniel Dunbar1-8/+15
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-03-31Driver: Add OptTable::getOptionKind.Daniel Dunbar1-3/+5
Also, removed default value for getOptionMetaVar. llvm-svn: 68146
2009-03-31Driver: Add extra parameters for help text to option definitions.Daniel Dunbar1-4/+18
- Currently unused. And yes, now may be about the time I want a TableGen backend. llvm-svn: 68139
2009-03-25Driver: Replace Option::ForwardToGCC by Option::DriverOption (whichDaniel Dunbar1-6/+1
matches the flag in Options.def). llvm-svn: 67679
2009-03-25Driver: Prep for tool chain specific argument translation.Daniel Dunbar1-1/+1
- 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-25gcc 4.3 finds my use of ^ suspicious.Daniel Dunbar1-1/+1
llvm-svn: 67673
2009-03-23Driver: Make argument parsing fast.Daniel Dunbar1-13/+32
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-23Driver: Fix off by one in computation of first searchable option.Daniel Dunbar1-1/+1
llvm-svn: 67552
2009-03-23Driver: Check that options are ordered properly (outside ofDaniel Dunbar1-5/+75
Release-Asserts mode). Also, avoid searching through option groups (which will never match). llvm-svn: 67548