aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/StringRef.h
Commit message (Collapse)AuthorAgeFilesLines
* Support/ADT/StringRef: Add find_last_of.Michael J. Spencer2010-11-301-0/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120495 91177308-0d34-0410-b5e6-96231b3b80d8
* StringRefs are POD-like.Benjamin Kramer2010-11-261-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120181 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Whitespace.Michael J. Spencer2010-11-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120166 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend StringRef's edit-distance algorithm to permit an upper bound on the ↵Douglas Gregor2010-10-191-1/+6
| | | | | | allowed edit distance git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116867 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid O(n*m) complexity in StringRef::find_first(_not)_of(StringRef).Benjamin Kramer2010-08-231-2/+2
| | | | | | | | | - Cache used characters in a bitset to reduce memory overhead to just 32 bytes. - On my core2 this code is faster except when the checked string was very short (smaller than the list of delimiters). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111817 91177308-0d34-0410-b5e6-96231b3b80d8
* StringRef tweaks:Benjamin Kramer2010-08-231-2/+4
| | | | | | | | - Respect find_first_of(char's From parameter instead of silently dropping it. - Prefer std::string() to std::string("") git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111814 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't pass in a null pointer to std::string's ctor, an empty stringChris Lattner2010-08-181-1/+4
| | | | | | | ref should produce an empty std::string. This fixes PR7879. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111332 91177308-0d34-0410-b5e6-96231b3b80d8
* Add StringRef::compare_numeric and use it to sort TableGen register records.Jakob Stoklund Olesen2010-05-261-0/+4
| | | | | | | This means that our Registers are now ordered R7, R8, R9, R10, R12, ... Not R1, R10, R11, R12, R2, R3, ... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104745 91177308-0d34-0410-b5e6-96231b3b80d8
* These functions don't need to access this.Dan Gohman2010-04-191-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101776 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an override to StringRef::getAsInteger which parses into an APInt.John McCall2010-02-281-0/+14
| | | | | | | | | | | | It gets its own implementation totally divorced from the (presumably performance-sensitive) routines which parse into a uint64_t. Add APInt::operator|=(uint64_t), which is situationally much better than using a full APInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97381 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix various doxygen warnings.Dan Gohman2010-02-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96779 91177308-0d34-0410-b5e6-96231b3b80d8
* give StringRef a const_iterator member.Chris Lattner2010-01-131-9/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93294 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix occurrence typoKovarththanan Rajaratnam2010-01-071-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92926 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement edit distance for StringRefDouglas Gregor2009-12-301-0/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92309 91177308-0d34-0410-b5e6-96231b3b80d8
* Change StringRef::startswith and StringRef::endswith to versions which are aEli Friedman2009-12-211-2/+4
| | | | | | | | bit more verbose, but optimize to much shorter code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91817 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the now obsolete algorithm include from StringRef.h.Benjamin Kramer2009-11-191-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89354 91177308-0d34-0410-b5e6-96231b3b80d8
* Workaround PR5482, because all the gcc versions that I had were miscompiling ↵Torok Edwin2009-11-191-7/+20
| | | | | | | | | | | StringRef: 4.2.4, 4.3.4, 4.4.2. The workaround is to use a local min/max implementation that takes an integer param, and not a reference to integer param (like std::min does). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89352 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix unused variables warnings.Eric Christopher2009-11-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88977 91177308-0d34-0410-b5e6-96231b3b80d8
* Use .data() instead of .c_str() when nul-termination is not needed.Dan Gohman2009-11-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88703 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch to smallvector. Also fix issue with using unsigend for MaxSplit.Rafael Espindola2009-11-131-10/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87068 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new split method to StringRef that puts the substrings in a vector.Rafael Espindola2009-11-131-0/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87058 91177308-0d34-0410-b5e6-96231b3b80d8
* StringRef(const char*) should not be used to turn null pointers into emptyDaniel Dunbar2009-11-121-1/+1
| | | | | | strings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87031 91177308-0d34-0410-b5e6-96231b3b80d8
* Add compare_lower and equals_lower methods to StringRef. Switch all users ofBenjamin Kramer2009-11-121-0/+8
| | | | | | | StringsEqualNoCase (from StringExtras.h) to it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87020 91177308-0d34-0410-b5e6-96231b3b80d8
* Add StringRef::split(StringRef), to complement StringRef::split(char).Daniel Dunbar2009-11-111-0/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86803 91177308-0d34-0410-b5e6-96231b3b80d8
* Add From arguments to StringRef search functions, and tweak doxyments.Daniel Dunbar2009-11-111-11/+19
| | | | | | Also, add unittests for find_first_of and find_first_not_of. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86770 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass StringRef by value.Daniel Dunbar2009-11-061-13/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86251 91177308-0d34-0410-b5e6-96231b3b80d8
* size_t, not unsigned here to silence a warning.Eric Christopher2009-10-221-26/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84900 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use identifiers that start with an underscore followedDan Gohman2009-10-011-2/+2
| | | | | | | by a capital letter, which invokes undefined behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83206 91177308-0d34-0410-b5e6-96231b3b80d8
* Create empty StringRef is incoming cstring is NULL.Devang Patel2009-09-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83082 91177308-0d34-0410-b5e6-96231b3b80d8
* write rfind in terms of npos as daniel requestedChris Lattner2009-09-201-6/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82414 91177308-0d34-0410-b5e6-96231b3b80d8
* move a couple non-trivial methods out of line, add new Chris Lattner2009-09-201-39/+23
| | | | | | | find_first_of/find_first_of methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82347 91177308-0d34-0410-b5e6-96231b3b80d8
* add size_t and a version of rfind that allows specification of whereChris Lattner2009-09-201-3/+9
| | | | | | | to scan from. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82343 91177308-0d34-0410-b5e6-96231b3b80d8
* add some more overloads of StringRef::getAsInteger forChris Lattner2009-09-191-1/+3
| | | | | | | 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/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82322 91177308-0d34-0410-b5e6-96231b3b80d8
* Add StringRef::{rfind, rsplit}Daniel Dunbar2009-09-161-2/+48
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82087 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix pasto in StringRef::count(char)Daniel Dunbar2009-08-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79356 91177308-0d34-0410-b5e6-96231b3b80d8
* Add StringRef::count({char,StringRef})Daniel Dunbar2009-08-181-0/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79354 91177308-0d34-0410-b5e6-96231b3b80d8
* Add StringRef::front (with some small tweaks while I was in the area).Daniel Dunbar2009-08-131-1/+8
| | | | | | | - Patch by Erick Tryzelaar git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78883 91177308-0d34-0410-b5e6-96231b3b80d8
* StringRef: Add find(char) and find(StringRef).Daniel Dunbar2009-08-111-15/+47
| | | | | | | Also, regroup functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78712 91177308-0d34-0410-b5e6-96231b3b80d8
* add a simple back() method to StringRef.Chris Lattner2009-08-101-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78544 91177308-0d34-0410-b5e6-96231b3b80d8
* Add StringRef::endswithDaniel Dunbar2009-08-051-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78197 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the RHS length instead of the LHS length. They are both the same,Chris Lattner2009-07-261-1/+1
| | | | | | | | | | | | | | but this ends up compiling code like this: int foo(const StringRef &R) { return R == "food"; } to use a constant sized memcmp instead of a variable memcmp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77160 91177308-0d34-0410-b5e6-96231b3b80d8
* Add StringRef::{slice, split}, two convenient string operations which are simpleDaniel Dunbar2009-07-261-3/+38
| | | | | | | and efficient on a StringRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77117 91177308-0d34-0410-b5e6-96231b3b80d8
* Define npos in a way that should make MSVC happier.Daniel Dunbar2009-07-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76785 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing includeDaniel Dunbar2009-07-211-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76655 91177308-0d34-0410-b5e6-96231b3b80d8
* Move StringRef comparison operators out of class.Daniel Dunbar2009-07-211-16/+38
| | | | | | | Also, tweak the return type of size(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76588 91177308-0d34-0410-b5e6-96231b3b80d8
* Add StringRef::{substr, startswith}.Daniel Dunbar2009-07-211-1/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76559 91177308-0d34-0410-b5e6-96231b3b80d8
* Add StringRef class, with fixes.Daniel Dunbar2009-07-211-0/+127
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76543 91177308-0d34-0410-b5e6-96231b3b80d8