Daniel Dunbar
880dfd38d8
StringRef(const char*) should not be used to turn null pointers into empty
...
strings.
llvm-svn: 87031
2009-11-12 21:26:11 +00:00
Benjamin Kramer
da70783da7
Add compare_lower and equals_lower methods to StringRef. Switch all users of
...
StringsEqualNoCase (from StringExtras.h) to it.
llvm-svn: 87020
2009-11-12 20:36:59 +00:00
Daniel Dunbar
da387a1c25
Add StringRef::split(StringRef), to complement StringRef::split(char).
...
llvm-svn: 86803
2009-11-11 05:19:11 +00:00
Daniel Dunbar
aa5d256b19
Add Triple::str() which returns the contents of the Triple as a string, as a more readable alternative to getTriple().
...
llvm-svn: 86773
2009-11-11 00:43:14 +00:00
Daniel Dunbar
16a5387db2
Add From arguments to StringRef search functions, and tweak doxyments.
...
Also, add unittests for find_first_of and find_first_not_of.
llvm-svn: 86770
2009-11-11 00:28:53 +00:00
Jeffrey Yasskin
23ac706aab
Fix DenseMap iterator constness.
...
This patch forbids implicit conversion of DenseMap::const_iterator to
DenseMap::iterator which was possible because DenseMapIterator inherited
(publicly) from DenseMapConstIterator. Conversion the other way around is now
allowed as one may expect.
The template DenseMapConstIterator is removed and the template parameter
IsConst which specifies whether the iterator is constant is added to
DenseMapIterator.
Actually IsConst parameter is not necessary since the constness can be
determined from KeyT but this is not relevant to the fix and can be addressed
later.
Patch by Victor Zverovich!
llvm-svn: 86636
2009-11-10 01:02:17 +00:00
Daniel Dunbar
e458fe6d8e
Add StringSwitch::Cases overloads, for matching multiple strings to a single
...
value.
llvm-svn: 86618
2009-11-09 23:05:44 +00:00
Daniel Dunbar
4daaf9d3f4
Pass StringRef by value.
...
llvm-svn: 86251
2009-11-06 10:58:06 +00:00
Douglas Gregor
790089c6e6
Add a bunch of missing "template" keywords to disambiguate dependent template names. GCC eats this ill-formed code, Clang does not. I already filed PR5404 to improve recovery in this case
...
llvm-svn: 86204
2009-11-06 00:12:53 +00:00
Douglas Gregor
cc2c05cb75
Make a few more LLVM headers parsable as standalone headers.
...
Fix some problems with the hidden copy constructors for
ImmutableMap/ImmutableSet found by Clang++.
llvm-svn: 86186
2009-11-05 23:01:30 +00:00
Zhongxing Xu
befbf73b93
add newline to make cl.exe happy.
...
llvm-svn: 85483
2009-10-29 05:07:14 +00:00
Douglas Gregor
354d1b85b2
A switch-on-string-literal construct that is a nice alternative to
...
cascading "ifs" of strcmps/memcmps.
llvm-svn: 85459
2009-10-29 00:34:30 +00:00
Evan Cheng
1c7dfce330
Remove getIEEEFloatParts and getIEEEDoubleParts. They are not needed.
...
llvm-svn: 85358
2009-10-28 01:08:17 +00:00
Evan Cheng
b6b5214744
Add new APFloat methods that return sign, exp, and mantissa of ieee float and double values.
...
llvm-svn: 85318
2009-10-27 21:35:42 +00:00
Mike Stump
a91d3ec5e9
Fix VS build, patch by Marius Wachtler.
...
llvm-svn: 85198
2009-10-27 02:17:51 +00:00
Chandler Carruth
766362c707
Move DataTypes.h to include/llvm/System, update all users. This breaks the last
...
direct inclusion edge from System to Support.
llvm-svn: 85086
2009-10-26 01:35:46 +00:00
Jeffrey Yasskin
bc5f122491
Fix stylistic and documentation problems in ValueMap found by Nick Lewycky and
...
Evan Cheng.
llvm-svn: 84967
2009-10-23 20:54:00 +00:00
Jeffrey Yasskin
e90afea0ba
Try r84890 again (adding ValueMap<>), now that I've tested the compile on
...
gcc-4.4.
llvm-svn: 84902
2009-10-22 22:11:22 +00:00
Eric Christopher
05ee62db65
size_t, not unsigned here to silence a warning.
...
llvm-svn: 84900
2009-10-22 22:06:50 +00:00
Benjamin Kramer
13aa437a5e
Random include cleanup.
...
llvm-svn: 84898
2009-10-22 21:49:41 +00:00
Jeffrey Yasskin
7555ed8cdc
Revert r84890, which broke the linux build.
...
llvm-svn: 84892
2009-10-22 20:23:43 +00:00
Jeffrey Yasskin
ad8692124f
Add a ValueMap<ValueOrSubclass*, T> type. ValueMap<Value*, T> is safe to use
...
even when keys get RAUWed and deleted during its lifetime. By default the keys
act like WeakVHs, but users can pass a third template parameter to configure
how updates work and whether to do anything beyond updating the map on each
action.
It's also possible to automatically acquire a lock around ValueMap updates
triggered by RAUWs and deletes, to support the ExecutionEngine.
llvm-svn: 84890
2009-10-22 20:10:20 +00:00
Eric Christopher
41d8dc960b
More warnings patrol: Another unused argument and more implicit
...
conversions.
llvm-svn: 84382
2009-10-17 23:56:18 +00:00
Daniel Dunbar
b67b5bb0b1
Move UnescapeString to a static function for its sole client; its inefficient and broken.
...
llvm-svn: 84358
2009-10-17 20:43:42 +00:00
Daniel Dunbar
d537c7d394
Remove llvm::EscapeString, raw_ostream::write_escaped is much faster.
...
llvm-svn: 84357
2009-10-17 20:43:29 +00:00
Daniel Dunbar
0107265e33
Move StringMap's string has function into StringExtras.h
...
llvm-svn: 84344
2009-10-17 18:21:06 +00:00
Chris Lattner
5d2b384837
Add half precision floating point support (float16) to APFloat,
...
patch by Peter Johnson! (PR5195)
llvm-svn: 84239
2009-10-16 02:13:51 +00:00
Chris Lattner
87bcf3b242
add haiku support, patch by Paul Davey!
...
llvm-svn: 84238
2009-10-16 02:06:30 +00:00
Dan Gohman
ae76dc48d6
Delete bogus semicolons.
...
llvm-svn: 84132
2009-10-14 20:39:01 +00:00
Eric Christopher
a7407c0921
Remove a bunch of unused arguments from functions, silencing a
...
warning.
llvm-svn: 84130
2009-10-14 20:28:33 +00:00
Ted Kremenek
abbc32c042
Provide a mode for ImmutableMap/ImmutableSet to not automatically canonicalize the internal functional AVL trees. This should speedup clients that use ImmutableMap/ImmutableSet but don't require fast comparisons of maps.
...
llvm-svn: 84010
2009-10-13 19:08:10 +00:00
Chris Lattner
8fbbd25816
remove dead header.
...
llvm-svn: 83943
2009-10-13 05:33:26 +00:00
Dan Gohman
f9067da535
Add a ceilLogBase2 function to APInt.
...
llvm-svn: 83932
2009-10-13 01:49:02 +00:00
Torok Edwin
8203691f27
Add a comment explaining how DenseMap::insert works, because it is not
...
intuitive.
It does NOT update the value if the key is already in the map,
it also returns false if the key is already in the map, regardless
if the value matched.
llvm-svn: 83458
2009-10-07 09:23:56 +00:00
Dan Gohman
7cdf41cf01
Don't use identifiers that start with an underscore followed
...
by a capital letter, which invokes undefined behavior.
llvm-svn: 83206
2009-10-01 17:39:52 +00:00
Devang Patel
5cad2b8f0f
Create empty StringRef is incoming cstring is NULL.
...
llvm-svn: 83082
2009-09-29 18:39:56 +00:00
Daniel Dunbar
ac9a646035
Switch FoldingSet::AddString to StringRef based API.
...
- This also fixes a dereference of std::string::end, which makes MSVC unhappy and was causing all the static analyzer clang tests to fail.
llvm-svn: 82517
2009-09-22 03:34:53 +00:00
Chris Lattner
e520a0c8e7
write rfind in terms of npos as daniel requested
...
llvm-svn: 82414
2009-09-20 22:54:26 +00:00
Chris Lattner
72732da2f0
move a couple non-trivial methods out of line, add new
...
find_first_of/find_first_of methods.
llvm-svn: 82347
2009-09-20 01:22:16 +00:00
Chris Lattner
2cdc7b8e76
add size_t and a version of rfind that allows specification of where
...
to scan from.
llvm-svn: 82343
2009-09-20 00:38:28 +00:00
Chris Lattner
d2a0138c62
add some more overloads of StringRef::getAsInteger for
...
common and useful integer types.
llvm-svn: 82338
2009-09-19 23:58:48 +00:00
Chris Lattner
4606ccf232
add a simple c_str() method to SmallString.
...
llvm-svn: 82337
2009-09-19 23:57:31 +00:00
Chris Lattner
e6fa81a475
provide a "strtoull" operation that works on StringRef's.
...
llvm-svn: 82322
2009-09-19 19:47:14 +00:00
John McCall
f2c6ae3996
Fix a few places where PointerIntPair was using PointerLikeTypeTraits<PointerTy>
...
instead of the PtrTraits provided. Allows PointerIntPair to contain a
PointerUnion safely, as long as the bits add up.
llvm-svn: 82163
2009-09-17 20:35:18 +00:00
Chris Lattner
09084c45af
add a version of the APFloat constructor that initializes to 0.0
...
llvm-svn: 82110
2009-09-17 01:08:43 +00:00
Daniel Dunbar
60e1dee7fa
Add StringRef::{rfind, rsplit}
...
llvm-svn: 82087
2009-09-16 22:38:48 +00:00
Dan Gohman
4e86738fa7
Fix apostrophos.
...
llvm-svn: 81856
2009-09-15 15:08:33 +00:00
Chris Lattner
f02eb61c69
switch scciterator to use DenseMap instead of std::map
...
llvm-svn: 81834
2009-09-15 04:37:49 +00:00
Chris Lattner
f0c81c94c9
give densemap iterators real iterator traits.
...
llvm-svn: 81538
2009-09-11 18:15:46 +00:00
Daniel Dunbar
12045a9061
Add Triple::getArchTypeForDarwinArchName, which converts a "Darwin" architecture
...
name (e.g. "ppc") to the appropriate constant.
Also, StringRefize additional Triple constructor.
llvm-svn: 81274
2009-09-08 23:32:51 +00:00