aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/CommandLine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Tidy up. s/Low Level Virtual Machine/LLVM/.Jim Grosbach2012-01-251-1/+1
| | | | | | LLVM isn't an acronym anymore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148985 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead default.David Blaikie2012-01-231-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148738 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing unused default switch cases in switches over enums that already ↵David Blaikie2012-01-161-6/+0
| | | | | | | | account for all enumeration values explicitly. (This time I believe I've checked all the -Wreturn-type warnings from GCC & added the couple of llvm_unreachables necessary to silence them. If I've missed any, I'll happily fix them as soon as I know about them) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148262 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r147542 after comments from Joerg SonnenbergerSebastian Pop2012-01-051-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147608 91177308-0d34-0410-b5e6-96231b3b80d8
* use getHostTriple instead of getDefaultTargetTriple in getClosestTargetForJITSebastian Pop2012-01-041-0/+1
| | | | | | | | | | Get back getHostTriple. For JIT compilation, use the host triple instead of the default target: this fixes some JIT testcases that used to fail when the compiler has been configured as a cross compiler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147542 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some missing anchors.David Blaikie2011-12-011-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145578 91177308-0d34-0410-b5e6-96231b3b80d8
* rename getHostTriple into getDefaultTargetTripleSebastian Pop2011-11-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143502 91177308-0d34-0410-b5e6-96231b3b80d8
* CommandLine: Add support for 64 bit unsigned integer options.Benjamin Kramer2011-09-151-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139848 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the registered target printing in version strings completely out ofChandler Carruth2011-07-221-7/+2
| | | | | | | | | | | | | | | | | the Support library. Now its part of the TargetRegistry, and the three commands that care about this explicitly register this extra bit of version information. The set of commands which care was computed by intersecting those which use the Support library's version string printing and those that initialize all the registered targets in a way that produces a meaningful list. The only odd ball out is that 'clang -cc1as -version' no longer prints the registered targets. I don't think anyone is really interested in that (especially as the fact that llvm-mc does so is under a FIXME), but if someone really does want this back I'll happily apply the same patch there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135757 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the logic for printing the registered targets into a staticChandler Carruth2011-07-221-26/+5
| | | | | | | function on the TargetRegistry. Also clean it up and use the modern LLVM utility libraries available instead of rolling a few things manually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135756 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an extension point to the CommandLine library where clients canChandler Carruth2011-07-221-3/+22
| | | | | | | | | | | | register extra version information to be printed. This is designed to allow those tools which link in various targets to also print those registered targets under --version. Currently this printing logic is embedded into the Support library directly; a huge layering violation. This is the first step to hoisting it out into the tools without adding lots of duplicated code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135755 91177308-0d34-0410-b5e6-96231b3b80d8
* Aliased flag options should be directed to stdout, not stderr to be ↵Evan Cheng2011-06-131-2/+2
| | | | | | consistent. Patch by Julien Lerouge. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132931 91177308-0d34-0410-b5e6-96231b3b80d8
* In option typo correction, consider -foo=VALUE flags as two distinct parts. TheNick Lewycky2011-05-021-5/+12
| | | | | | | | | | | comments claimed it did this, but the LHS value was actually an unused variable. The new system considers only the '-foo' part when comparing it for typos against flags that have values, but still look at the whole string for flags that don't. That way, we'll still correct '-inst=combine' to '-instcombine'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130685 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a few instances of "warning: extra ';' outside of a function [-pedantic]".Frits van Bommel2011-04-061-7/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129002 91177308-0d34-0410-b5e6-96231b3b80d8
* Added *hidden* flags -print-options and -print-all-options soAndrew Trick2011-04-051-26/+150
| | | | | | | | | | | | | | | | | | | | developers can see if their driver changed any cl::Option's. The current implementation isn't perfect but handles most kinds of options. This is nice to have when decomposing the stages of compilation and moving between different drivers. It's also a good sanity check when comparing results produced by different command line invocations that are expected to produce the comparable results. Note: This is not an attempt to prolong the life of cl::Option. On the contrary, it's a placeholder for a feature that must exist when cl::Option is replaced by a more appropriate framework. A new framework needs: a central option registry, dynamic name lookup, non-global containers of option values (e.g. per-module, per-function), *and* the ability to print options values and their defaults at any point during compilation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128910 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/CommandLine: Fix LookupNearestOption to also search extra option names.Daniel Dunbar2011-01-241-10/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124124 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/CommandLine: Add "Did you mean" print for mismatched operands.Daniel Dunbar2011-01-181-0/+39
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123717 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/PathV1: Deprecate getLast.Michael J. Spencer2010-12-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122116 91177308-0d34-0410-b5e6-96231b3b80d8
* MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> ↵Michael J. Spencer2010-12-161-6/+3
| | | | | | via an out parm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121958 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with ↵Michael J. Spencer2010-12-091-1/+3
| | | | | | error_code &ec. And fix clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121379 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a use after free. Patch by Frits van Bommel.Rafael Espindola2010-11-191-6/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119842 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new configure option, --disable-timestamps, intended to turn off ↵Daniel Dunbar2010-05-101-0/+2
| | | | | | | | | anything which would mess up binary/object comparisons. Currently: - Disables 'Built on ...' in 'foo --version'. - Disables timestamps from being embedded into .dir files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103423 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix minor style issues.Dan Gohman2010-03-241-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99414 91177308-0d34-0410-b5e6-96231b3b80d8
* Refer to -help instead of --help since this is what tools themselves say.Duncan Sands2010-02-181-7/+7
| | | | | | | | | Also, have tools output -help-hidden rather than refer to --help-hidden, for consistency, and likewise adjust documentation. This doesn't change every mention of --help, only those which seemed clearly safe. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96578 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace strcpy with memcpy when we have the length around anyway.Benjamin Kramer2010-01-281-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94746 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress use of uninitialized variable warning.Duncan Sands2010-01-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93046 91177308-0d34-0410-b5e6-96231b3b80d8
* Change errs() to dbgs().David Greene2010-01-051-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92646 91177308-0d34-0410-b5e6-96231b3b80d8
* Print a newline after the Args: line so that unrelated errs() output doesn'tDan Gohman2009-12-031-1/+2
| | | | | | | end up on the same line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90473 91177308-0d34-0410-b5e6-96231b3b80d8
* Perform explicit instantiations in the proper namespace, since Clang ↵Douglas Gregor2009-11-251-0/+2
| | | | | | diagnoses this ill-formity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89846 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the handling of CommaSeparated options into ProvideOption.Mikhail Glushenkov2009-11-201-23/+33
| | | | | | | | Makes '--comma-separated val1,val2' mean the same thing as '--comma-separated=val1,val2' (that is, 'val1' and 'val2' are not lumped together as 'val1,val2'). Also declutters the main loop a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89463 91177308-0d34-0410-b5e6-96231b3b80d8
* Trailing whitespace.Mikhail Glushenkov2009-11-191-25/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89364 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert CPU detection code to return "generic" instead of an empty string in caseBenjamin Kramer2009-11-171-1/+1
| | | | | | | | of failure. The x86 target didn't like empty cpu names and broke x86 tests on non-x86 buildbots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89111 91177308-0d34-0410-b5e6-96231b3b80d8
* Report the detected host CPU in --version.Daniel Dunbar2009-11-141-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88813 91177308-0d34-0410-b5e6-96231b3b80d8
* Show command-line args and features passed into backend in debug output. ↵Sandeep Patel2009-11-111-0/+6
| | | | | | Approved by Evan Cheng. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86797 91177308-0d34-0410-b5e6-96231b3b80d8
* Bugfix for the CommaSeparated option. The original code was adding the wholeNicolas Geoffray2009-10-061-0/+1
| | | | | | | | string at the end of the list, instead of the last comma-separated string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83405 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply r82348 with a fix, thanks Jeffrey.Chris Lattner2009-09-241-33/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82683 91177308-0d34-0410-b5e6-96231b3b80d8
* Roll back r82348, which introduced an infinite loop in ParseCStringVector() thatJeffrey Yasskin2009-09-241-22/+33
| | | | | | | | | a trivial unittest would have caught. This revision also adds the trivial unittest. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82675 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy upChris Lattner2009-09-201-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82384 91177308-0d34-0410-b5e6-96231b3b80d8
* smallvectorize getExtraOptionNamesChris Lattner2009-09-201-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82377 91177308-0d34-0410-b5e6-96231b3b80d8
* minor cleanups.Chris Lattner2009-09-201-22/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82375 91177308-0d34-0410-b5e6-96231b3b80d8
* strength reduce further StringRef-> const char*, saving another 620 bytes.Chris Lattner2009-09-201-5/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82372 91177308-0d34-0410-b5e6-96231b3b80d8
* switch an std::string to StringRef, shaving 400 bytes off CommandLine.oChris Lattner2009-09-201-11/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82370 91177308-0d34-0410-b5e6-96231b3b80d8
* the switch from std::map -> StringMap caused --help output to be in Chris Lattner2009-09-201-5/+15
| | | | | | | non-sorted order, restore the sort. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82368 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the duplicate detection loop, moving it into the loop that ↵Chris Lattner2009-09-201-13/+6
| | | | | | populates the Opts vector in the first place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82367 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate a masochistic "algorithm" loop, shrinking CommandLine.o from ↵Chris Lattner2009-09-201-13/+8
| | | | | | 71524->70700 bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82366 91177308-0d34-0410-b5e6-96231b3b80d8
* don't use count + insert, just do insert + failure. Also, instead of ↵Chris Lattner2009-09-201-6/+9
| | | | | | | | | deleting from the middle of a vector, swap the last element in and pop_back. Also saves 330 bytes :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82365 91177308-0d34-0410-b5e6-96231b3b80d8
* switch to SmallPtrSet instead of std::set, saving 1K from theChris Lattner2009-09-201-4/+4
| | | | | | | release-asserts .o file (72900->71856). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82364 91177308-0d34-0410-b5e6-96231b3b80d8
* change an std::sort to an array_pod_sort call, shrinking CommandLine.o by 9%.Chris Lattner2009-09-201-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82363 91177308-0d34-0410-b5e6-96231b3b80d8
* Several changes together in a murky mess:Chris Lattner2009-09-201-84/+102
| | | | | | | | | | | | | 1. Change some "\n" -> '\n'. 2. eliminte some std::string's by using raw_ostream::indent. 3. move a bunch of code out of the main arg parser routine into a new static HandlePrefixedOrGroupedOption function. 4. Greatly simplify the implementation of getOptionPred, and make it avoid splitting prefix options at = when that doesn't match a non-prefix option. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82362 91177308-0d34-0410-b5e6-96231b3b80d8