aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* Move UnescapeString to a static function for its sole client; its ↵Daniel Dunbar2009-10-171-30/+0
| | | | | | inefficient and broken. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84358 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove llvm::EscapeString, raw_ostream::write_escaped is much faster.Daniel Dunbar2009-10-171-26/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84357 91177308-0d34-0410-b5e6-96231b3b80d8
* Add raw_ostream::write_escaped, for writing escaped strings.Daniel Dunbar2009-10-171-0/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84355 91177308-0d34-0410-b5e6-96231b3b80d8
* Move StringMap's string has function into StringExtras.hDaniel Dunbar2009-10-171-16/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84344 91177308-0d34-0410-b5e6-96231b3b80d8
* Add half precision floating point support (float16) to APFloat,Chris Lattner2009-10-161-1/+69
| | | | | | | patch by Peter Johnson! (PR5195) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84239 91177308-0d34-0410-b5e6-96231b3b80d8
* add haiku support, patch by Paul Davey!Chris Lattner2009-10-161-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84238 91177308-0d34-0410-b5e6-96231b3b80d8
* r83391 was completely broken since Twines keep references to their inputs, andJeffrey Yasskin2009-10-061-4/+9
| | | | | | | | some of the inputs were temporaries. Here's a real fix for the miscompilation. Thanks to sabre for pointing out the problem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83417 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
* Fix PR5112, a miscompilation on gcc-4.0.3. Patch by Collin Winter!Jeffrey Yasskin2009-10-061-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83391 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid using mutex locks if not in multithreaded mode by using a SmartScopedMutexEdwin Török2009-09-271-2/+2
| | | | | | | in RegisterStatistic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82896 91177308-0d34-0410-b5e6-96231b3b80d8
* remove support for "NoSub" from regex. It seems like a minor optimizationChris Lattner2009-09-261-15/+12
| | | | | | | and makes the API more annoying. Add a Regex::getNumMatches() method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82877 91177308-0d34-0410-b5e6-96231b3b80d8
* add and document regex support for FileCheck. You can now do stuff like:Chris Lattner2009-09-241-2/+3
| | | | | | | | | | ; CHECK: movl {{%e[a-z][xi]}}, %eax or whatever. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82717 91177308-0d34-0410-b5e6-96231b3b80d8
* wrap long lines.Chris Lattner2009-09-241-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82715 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy up, fix a memory leak in Regex::isValidChris Lattner2009-09-241-13/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82707 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
* Switch FoldingSet::AddString to StringRef based API.Daniel Dunbar2009-09-221-11/+3
| | | | | | - This also fixes a dereference of std::string::end, which makes MSVC unhappy and was causing all the static analyzer clang tests to fail. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82517 91177308-0d34-0410-b5e6-96231b3b80d8
* Workaround what I believe is an MSVC bug where it emits a definition for aDaniel Dunbar2009-09-221-0/+3
| | | | | | | | static const class member into each translation unit, with external linkage??? - If someone understands this issue better, please clue me in, I haven't consulted the standard yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82516 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify as daniel suggestsChris Lattner2009-09-201-16/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82415 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
* Fix refacto, this code was expecting to stride past the argument prefix.Daniel Dunbar2009-09-201-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82360 91177308-0d34-0410-b5e6-96231b3b80d8
* Tabs -> spaces, and remove trailing whitespace.Daniel Dunbar2009-09-201-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82355 91177308-0d34-0410-b5e6-96231b3b80d8
* convert argname to StringRef, simplifying LookupOption.Chris Lattner2009-09-201-21/+22
| | | | 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-201-12/+8
| | | | | | | 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-201-21/+26
| | | | | | | | | 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-201-33/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82348 91177308-0d34-0410-b5e6-96231b3b80d8
* move a couple non-trivial methods out of line, add new Chris Lattner2009-09-201-0/+71
| | | | | | | find_first_of/find_first_of methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82347 91177308-0d34-0410-b5e6-96231b3b80d8
* coding style cleanupChris Lattner2009-09-201-13/+12
| | | | 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-201-28/+29
| | | | | | | | | | 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-201-11/+9
| | | | | | | 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-191-19/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82339 91177308-0d34-0410-b5e6-96231b3b80d8
* add some more overloads of StringRef::getAsInteger forChris Lattner2009-09-191-0/+45
| | | | | | | common and useful integer types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82338 91177308-0d34-0410-b5e6-96231b3b80d8
* provide a "strtoull" operation that works on StringRef's.Chris Lattner2009-09-191-0/+63
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82322 91177308-0d34-0410-b5e6-96231b3b80d8
* convert a bunch of std::strings to use StringRef. This should eliminateChris Lattner2009-09-191-48/+56
| | | | | | | | 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-191-28/+28
| | | | | | | | | - 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
* add a version of the APFloat constructor that initializes to 0.0Chris Lattner2009-09-171-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82110 91177308-0d34-0410-b5e6-96231b3b80d8
* Add StringRef::{rfind, rsplit}Daniel Dunbar2009-09-162-0/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82087 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop the raw_ostream required buffer size to 1.Daniel Dunbar2009-09-151-2/+2
| | | | | | | - As best I can tell, we have eliminated all the code which used to require a larger buffer size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81912 91177308-0d34-0410-b5e6-96231b3b80d8
* Update CMake files.Ted Kremenek2009-09-111-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81577 91177308-0d34-0410-b5e6-96231b3b80d8