1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
Commit Graph

1306 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis
20ba865302 Move "clang/Analysis/Support/SaveAndRestore.h" to "llvm/ADT/SaveAndRestore.h"
to make it more widely available.

llvm-svn: 151564
2012-02-27 21:08:33 +00:00
Jay Foad
e019c92c2a Help the compiler to eliminate some dead code when hashing an array of T
where sizeof (T) is a multiple of 4.

llvm-svn: 151523
2012-02-27 11:00:17 +00:00
Jay Foad
6414ccdb33 The implementation of GeneralHash::addBits broke C++ aliasing rules; fix
it with memcpy. This also fixes a problem on big-endian hosts, where
addUnaligned would return different results depending on the alignment
of the data.

llvm-svn: 151247
2012-02-23 09:16:04 +00:00
Duncan Sands
0ff5453040 GCC warns about a comparison between signed and unsigned values.
llvm-svn: 151243
2012-02-23 08:23:53 +00:00
Andrew Trick
2cb2c4c487 PostRASched: Convert physreg def/use tracking to Jakob's SparseSet.
Added array subscript to SparseSet for convenience.
Slight reorg to make it easier to manage the def/use sets.

llvm-svn: 151228
2012-02-23 01:52:38 +00:00
Jakob Stoklund Olesen
0d60aa4b33 Fix typos.
llvm-svn: 151163
2012-02-22 16:01:54 +00:00
Chandler Carruth
c5b687b241 Support was removed from LLVM's MIPS backend for the PSP variant of that
chip in r139383, and the PSP components of the triple are really
annoying to parse. Let's leave this chapter behind. There is no reason
to expect LLVM to see a PSP-related triple these days, and so no
reasonable motivation to support them.

It might be reasonable to prune a few of the older MIPS triple forms in
general, but as those at least cause no burden on parsing (they aren't
both a chip and an OS!), I'm happy to leave them in for now.

llvm-svn: 151156
2012-02-22 11:32:54 +00:00
NAKAMURA Takumi
a6003dae39 ADT/SparseSet.h: Fix up header dependencies.
llvm-svn: 151114
2012-02-22 01:19:35 +00:00
Jakob Stoklund Olesen
3b18c7d900 Add a Briggs and Torczon sparse set implementation.
For objects that can be identified by small unsigned keys, SparseSet
provides constant time clear() and fast deterministic iteration. Insert,
erase, and find operations are typically faster than hash tables.

SparseSet is useful for keeping information about physical registers,
virtual registers, or numbered basic blocks.

llvm-svn: 151110
2012-02-22 00:56:08 +00:00
Chandler Carruth
b2adf74ff3 Pull the parsing helper functions out of the Triple interface entirely.
They're private static methods but we can just make them static
functions in the implementation. It makes the implementations a touch
more wordy, but takes another chunk out of the header file.

Also, take the opportunity to switch the names to the new coding
conventions.

No functionality changed here.

llvm-svn: 151047
2012-02-21 08:53:32 +00:00
Chandler Carruth
12774336b5 Clean up comments that I missed when changing the triple representation.
Somehow, I even missed the ones I wrote just the other day...

Thanks to Matt for the code review.

llvm-svn: 151045
2012-02-21 08:31:18 +00:00
Chandler Carruth
34c9c293e1 Switch the llvm::Triple class to immediately parse the triple string on
construction. Simplify its interface, implementation, and users
accordingly as there is no longer an 'uninitialized' state to check for.
Also, fixes a bug lurking in the interface as there was one method that
didn't correctly check for initialization.

llvm-svn: 151024
2012-02-21 03:39:36 +00:00
Chandler Carruth
132aecc08e Move constructors out-of-line and flesh out their documentation. No
functionality changed. This is in preparation for some refactoring of
how this class behaves.

llvm-svn: 150941
2012-02-20 00:02:47 +00:00
Talin
777c85d862 Hashing.h - utilities for hashing various data types.
llvm-svn: 150890
2012-02-18 21:00:49 +00:00
Pete Cooper
090f52e5c9 Template specialize SmallVector::push_back based on POD-ness of the type. Reduces clang binary by 188KB
llvm-svn: 150662
2012-02-16 04:58:48 +00:00
Kaelyn Uhrain
874c22ce25 Add function for computing the edit distance of two arrays.
Accomplished by moving the body of StringRef::edit_distance into
a separate function that accepts two ArrayRefs, and making
StringRef::edit_distance a wrapper around the new function.

llvm-svn: 150621
2012-02-15 22:13:07 +00:00
Ahmed Charles
bf926759cc Fix various issues (or do cleanups) found by enabling certain MSVC warnings.
- Use unsigned literals when the desired result is unsigned. This mostly allows unsigned/signed mismatch warnings to be less noisy even if they aren't on by default.
- Remove misplaced llvm_unreachable.
- Add static to a declaration of a function on MSVC x86 only.
- Change some instances of calling a static function through a variable to simply calling that function while removing the unused variable.

llvm-svn: 150364
2012-02-13 06:30:56 +00:00
Chandler Carruth
a05c6dc02c Introduce helpers to compute the 32-bit varaints and 64-bit variants of
some architectures. These are useful for interacting with multiarch or
bi-arch GCC (or GCC-based) toolchains.

llvm-svn: 149895
2012-02-06 20:46:33 +00:00
Benjamin Kramer
0d983ac1b6 SmallVector's construct_range is the same thing as std::uninitialized_fill, no need to reinvent it.
llvm-svn: 149851
2012-02-05 22:48:31 +00:00
Benjamin Kramer
5e6c218c54 Simplify code. No functionality change.
llvm-svn: 149850
2012-02-05 22:14:48 +00:00
Craig Topper
e18a06be4d Convert assert(0) to llvm_unreachable
llvm-svn: 149849
2012-02-05 22:14:15 +00:00
Chandler Carruth
9db1b1bb0a Begin fleshing out more convenience predicates in llvm::Triple and
convert at least one client over to use them. Subsequent patches both to
LLVM and Clang will try to convert more people over to a common set of
predicates.

This round of predicates is focused on OS-categorization predicates.

llvm-svn: 149815
2012-02-05 08:26:40 +00:00
Bob Wilson
caefeeb04d Add Triple::getMacOSXVersion to replace crufty code in the clang driver.
This new function provides a way to get the Mac OS X version number from
either generic "darwin" triples of macosx triples.

llvm-svn: 149438
2012-01-31 22:32:29 +00:00
Manuel Klimek
bd5c3cbb68 RefCountedBaseVPTR needs the IntrusiveRefCntPtrInfo as friend,
now that this handles the release / retain calls.

Adds a regression test for that bug (which is a compile-time
regression) and for the last two changes to the IntrusiveRefCntPtr,
especially tests for the memory leak due to copy construction of the
ref-counted object and ensuring that the traits are used for release /
retain calls.

llvm-svn: 149411
2012-01-31 19:58:34 +00:00
Chandler Carruth
a71c1f9470 Add various coarse bit-width architecture predicates to llvm::Triple.
These are very useful for frontends and other utilities reasoning about
or selecting between triples.

llvm-svn: 149353
2012-01-31 04:52:32 +00:00
Ted Kremenek
add0641097 Relax constructor for IntrusiveRefCntPtr to not be explicit.
llvm-svn: 149309
2012-01-31 00:57:08 +00:00
Ted Kremenek
0022d6619e Use traits for IntrusiveRefCntPtr to determine how to increment/decrement a reference count.
llvm-svn: 149308
2012-01-31 00:57:04 +00:00
Talin
d6b8c10155 DenseMap::find_as() and unit tests.
llvm-svn: 149229
2012-01-30 06:55:43 +00:00
Chandler Carruth
0a86383339 Cleanup the organization of some methods in llvm::Triple and provide
a better doxyment group for convenience predicates.

llvm-svn: 149211
2012-01-29 23:09:12 +00:00
Jakob Stoklund Olesen
033045b6da Add a BitVector::reset(BitVector&) method.
The alternative LHS &= ~RHS is way too slow because it creates a
temporary that calls malloc/free.

llvm-svn: 149187
2012-01-29 01:29:22 +00:00
Rafael Espindola
7bddde2b49 Add r149110 back with a fix for when the vector and the int have the same
width.

llvm-svn: 149151
2012-01-27 23:33:07 +00:00
Talin
12820f024e Additional methods for SmallString.
llvm-svn: 148881
2012-01-24 23:43:59 +00:00
Chris Lattner
1c091db526 add ::drop_back() and ::drop_front() methods, which are like pop_front/pop_back on a vector, but a) aren't destructive to "this", and b) can take a # elements to drop.
llvm-svn: 148791
2012-01-24 08:58:57 +00:00
Chris Lattner
cfea666af2 Various public StringMap methods take or return "MapEntryTy", make it public.
llvm-svn: 148732
2012-01-23 21:42:52 +00:00
Chris Lattner
7f4e7ce468 revert r148688 too, this isn't safe for DenseMap use. When DenseMap resizes, it will need to copy around arbitrary pointers
llvm-svn: 148699
2012-01-23 15:10:41 +00:00
Chris Lattner
0a21f75290 allow OwningPtr to be copy constructed if null, which is required to
make them be a valuetype in a DenseMap.

llvm-svn: 148688
2012-01-23 08:19:57 +00:00
Benjamin Kramer
14636e5e0a Protect SmallVectorImpl's constructor and a few other methods that aren't meant to be public.
llvm-svn: 148550
2012-01-20 16:39:46 +00:00
Chris Lattner
b57d05e24b Introduce a new MutableArrayRef class, which refers to a series of mutable
T's that are consequtively in memory.

llvm-svn: 148463
2012-01-19 06:34:52 +00:00
Rafael Espindola
700f91def8 Add support for the gnueabihf environment. Patch by Sylvestre Ledru.
llvm-svn: 148434
2012-01-18 23:35:29 +00:00
Jakub Staszak
c3dc479049 Trailing spaces.
llvm-svn: 148332
2012-01-17 20:58:08 +00:00
Chris Lattner
c54b1a7001 add some missing const qualifiers.
llvm-svn: 148274
2012-01-17 01:31:32 +00:00
Jakob Stoklund Olesen
4004b18f94 Add portable bit mask operations to BitVector.
BitVector uses the native word size for its internal representation.
That doesn't work well for literal bit masks in source code.

This patch adds BitVector operations to efficiently apply literal bit
masks specified as arrays of uint32_t.  Since each array entry always
holds exactly 32 bits, these portable bit masks can be source code
literals, probably produced by TableGen.

llvm-svn: 148272
2012-01-17 01:24:32 +00:00
Chandler Carruth
ecd9169f3a Teach the triple library about the androideabi environment.
Patch by Evgeniy Stepanov.

llvm-svn: 147871
2012-01-10 19:46:00 +00:00
Benjamin Kramer
0ce9fd3032 Remove VectorExtras. This unused helper was written for a type of API that is discouraged now.
llvm-svn: 147738
2012-01-07 19:42:13 +00:00
Benjamin Kramer
b13cdd4879 Port the trick to skip the check for empty buckets from StringMap to DenseMap.
This should fix the odd behavior that find() is slower than lookup().

llvm-svn: 147731
2012-01-07 13:12:07 +00:00
Chris Lattner
8a6a27b69a allow clients of SmallSet to specify their own comparison function for the set.
Patch by Stepan Dyatkovskiy!

llvm-svn: 147607
2012-01-05 17:35:07 +00:00
Benjamin Kramer
15f1af87d2 StringMap.find never points to an empty bucket or tombstone, skip the check.
llvm-svn: 147546
2012-01-04 20:45:14 +00:00
Benjamin Kramer
77f9c9f719 Switch StringMap from an array of structures to a structure of arrays.
- -25% memory usage of the main table on x86_64 (was wasted in struct padding).
- no significant performance change.

llvm-svn: 147294
2011-12-27 20:35:07 +00:00
Lang Hames
4258202987 Fixed typo.
llvm-svn: 147113
2011-12-22 00:12:51 +00:00
David Blaikie
576aba04f1 Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
llvm-svn: 146960
2011-12-20 02:50:00 +00:00