summaryrefslogtreecommitdiff
path: root/lib/Support/CommandLine.cpp
Commit message (Collapse)AuthorAge
* Add new configure option, --disable-timestamps, intended to turn off ↵Daniel Dunbar2010-05-10
| | | | | | | | | 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-24
| | | | 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-18
| | | | | | | | | 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-28
| | | | 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-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93046 91177308-0d34-0410-b5e6-96231b3b80d8
* Change errs() to dbgs().David Greene2010-01-05
| | | | 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-03
| | | | | | | 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-25
| | | | | | 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-20
| | | | | | | | 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-19
| | | | 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-17
| | | | | | | | 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-14
| | | | 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-11
| | | | | | 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-06
| | | | | | | | 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-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-24
| | | | | | | | | 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-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82384 91177308-0d34-0410-b5e6-96231b3b80d8
* smallvectorize getExtraOptionNamesChris Lattner2009-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82377 91177308-0d34-0410-b5e6-96231b3b80d8
* minor cleanups.Chris Lattner2009-09-20
| | | | 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-20
| | | | 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-20
| | | | 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-20
| | | | | | | 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-20
| | | | | | 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-20
| | | | | | 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-20
| | | | | | | | | 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-20
| | | | | | | 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-20
| | | | 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-20
| | | | | | | | | | | | | 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
* Fix refacto, this code was expecting to stride past the argument prefix.Daniel Dunbar2009-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82360 91177308-0d34-0410-b5e6-96231b3b80d8
* convert argname to StringRef, simplifying LookupOption.Chris Lattner2009-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82352 91177308-0d34-0410-b5e6-96231b3b80d8
* convert 'Value' to StringRef which makes it easier to Chris Lattner2009-09-20
| | | | | | | maintain the "null is unspecified, empty is empty" semantics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82351 91177308-0d34-0410-b5e6-96231b3b80d8
* Change CommaSeparated processing to do it with StringRef instead of ↵Chris Lattner2009-09-20
| | | | | | | | | temporary std::strings. This requires StringRef'izing ProvideOption which I also did. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82350 91177308-0d34-0410-b5e6-96231b3b80d8
* rewrite ParseCStringVector in terms of stringref.Chris Lattner2009-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82348 91177308-0d34-0410-b5e6-96231b3b80d8
* coding style cleanupChris Lattner2009-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82346 91177308-0d34-0410-b5e6-96231b3b80d8
* convert a bunch more stuff to use StringRef. The ArgName arguments are nowChris Lattner2009-09-20
| | | | | | | | | | stringref because they may not be nul terminated. For options like -Lfoo this now avoids a O(n) temporary std::strings where N is the length of the string after -L. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82345 91177308-0d34-0410-b5e6-96231b3b80d8
* avoid a bunch of malloc thrashing for PositinoalVals by eliminatingChris Lattner2009-09-20
| | | | | | | a std::vector and a bunch of std::string temporaries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82341 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid some temporary strings.Chris Lattner2009-09-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82339 91177308-0d34-0410-b5e6-96231b3b80d8
* convert a bunch of std::strings to use StringRef. This should eliminateChris Lattner2009-09-19
| | | | | | | | a massive number of temporary strings created when parsing a command line. More still left to eliminate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82318 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to speed up the slowest parts of the CommandLine libraryBenjamin Kramer2009-09-19
| | | | | | | | | - Replace std::map<std::string with StringMap - Eliminate unnecessary std::string copies - ~10% speed-up for clang's testsuite on my machine (debug build) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82312 91177308-0d34-0410-b5e6-96231b3b80d8
* Show derived host triple in --version.Daniel Dunbar2009-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80855 91177308-0d34-0410-b5e6-96231b3b80d8
* clean up #includes.Chris Lattner2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79857 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove uses of Streams.h from CommandLine.cpp, fix some whitespace and other ↵Benjamin Kramer2009-08-23
| | | | | | minor tweaks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79847 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some uses of llvm/Support/Streams.hChris Lattner2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79842 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove duplicated colons and spaces.Benjamin Kramer2009-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77892 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort list of targets in --version.Daniel Dunbar2009-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77127 91177308-0d34-0410-b5e6-96231b3b80d8
* Add registered target list to --version output.Daniel Dunbar2009-07-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75889 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-14
| | | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-11
| | | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert more assert(0)+abort() -> LLVM_UNREACHABLE,Torok Edwin2009-07-11
| | | | | | | and abort()/exit() -> llvm_report_error(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75363 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for a character after a command line option. Like '-Os'.Bill Wendling2009-04-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70437 91177308-0d34-0410-b5e6-96231b3b80d8