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

1361 Commits

Author SHA1 Message Date
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
Chris Lattner
151b0ec955 add a method to improve compatibility with SmallVector.
llvm-svn: 146928
2011-12-20 00:03:41 +00:00
Chandler Carruth
c8e6351626 As Doug pointed out (and I really should know), it is perfectly easy to
make VariadicFunction actually be trivial. Do so, and also make it look
more like your standard trivial functor by making it a struct with no
access specifiers. The unit test is updated to initialize its functors
properly.

llvm-svn: 146827
2011-12-17 10:20:15 +00:00
Chandler Carruth
0339ff36c1 Make GCC happy by using makeAraryRef instead of the implicit conversion.
I have no idea why GCC can't cope with the implicit conversion and Clang
can, or whose bug it is. Grr.

llvm-svn: 146732
2011-12-16 09:36:16 +00:00
Chandler Carruth
1cf4d2d1ae Add a generic collection of class templates to ADT for building
variadic-like functions in C++98. See the comments in the header file
for a more detailed description of how these work. We plan to use these
extensively in the AST matching library. This code and idea were
originally authored by Zhanyong Wan. I've condensed it using macros
to reduce repeatition and adjusted it to fit better with LLVM's ADT.

Thanks to both David Blaikie and Doug Gregor for the review!

llvm-svn: 146729
2011-12-16 08:58:59 +00:00
Tony Linthicum
61adbf8dc5 Hexagon backend support
llvm-svn: 146412
2011-12-12 21:14:40 +00:00
Michael J. Spencer
d85f1f84f3 Support/FileSystem: Implement recursive_directory_iterator and make
directory_iterator preserve InputIterator semantics on copy.

llvm-svn: 146200
2011-12-08 22:50:09 +00:00
David Blaikie
4b898ea444 Adding missing anchor to DATDeltaAlgorithm.
llvm-svn: 146025
2011-12-07 06:44:23 +00:00
Chris Lattner
edb34dd40a allow TinyPtrVector to implicitly convert to ArrayRef.
llvm-svn: 145898
2011-12-06 02:00:33 +00:00
Nick Lewycky
389fa6c38d Silence tsan false-positives (tsan can't track things which are only safe due to
memory fences) in statistics registration, which works the same way that
ManagedStatic registration does.

llvm-svn: 145869
2011-12-05 23:07:05 +00:00
Anna Zaks
431b43fdbe Change the Dominators recalculate() function to only rely on GraphTraits
This is a patch by Guoping Long!

As part of utilizing LLVM Dominator computation in Clang, made two changes to LLVM dominators tree implementation:

 - (1) Change the recalculate() template function to only rely on GraphTraits.
 - (2) Add a size() method to GraphTraits template class to query the number of nodes in the graph.

llvm-svn: 145837
2011-12-05 19:17:04 +00:00
Benjamin Kramer
a41c3f4eff Handle more cases in APInt::getLowBitsSet's fast path.
llvm-svn: 145249
2011-11-28 16:56:38 +00:00
Ted Kremenek
5b61764405 Fix bug in RefCountedBase/RefCountedBaseVPTR where the reference count was accidentally copied as part of the copy constructor. This could result in objects getting leaked because there reference count was too high.
llvm-svn: 144931
2011-11-17 23:02:14 +00:00
Benjamin Kramer
c597902ecc Replace (Lower|Upper)caseString in favor of StringRef's newest methods.
llvm-svn: 143891
2011-11-06 20:37:06 +00:00
Daniel Dunbar
7b66487335 ADT/StringRef: Add ::lower() and ::upper() methods.
llvm-svn: 143880
2011-11-06 18:04:43 +00:00
Dan Gohman
892b86e74c Remove the Alpha backend.
llvm-svn: 143164
2011-10-27 22:56:32 +00:00
Dan Gohman
77125e4240 Remove the Blackfin backend.
llvm-svn: 142880
2011-10-25 00:05:42 +00:00
Dan Gohman
b54d296fd4 Remove the SystemZ backend.
llvm-svn: 142878
2011-10-24 23:48:32 +00:00
Duncan Sands
4afb312617 Avoid warnings about the parameter G being unused.
llvm-svn: 142573
2011-10-20 08:56:41 +00:00
Eli Friedman
400fe75ba1 Use unsigned multiply to hash integers, so we don't end up with undefined behavior for large signed integers. Based on patch by Ahmed Charles.
llvm-svn: 141827
2011-10-12 22:25:45 +00:00
Andrew Trick
4c8a7dc833 Allow stat += 0 without activating the stat.
For me, this is a nice convenience. We generally want grep to match
stats output only when the event has occurred.

llvm-svn: 141574
2011-10-10 19:48:56 +00:00
Andrew Trick
fe8c38a61e whitespace
llvm-svn: 141572
2011-10-10 19:35:46 +00:00
Ted Kremenek
744f9cc17c Make canonicalization of ImmutableSetRef::asImmutableSet() semi-explicit.
llvm-svn: 140959
2011-10-02 01:47:07 +00:00
Anna Zaks
76528b198e Add getTreeFactory() to ImmutableSet to allow construction of ImmutableSetRef from an ImmutableSet object.
llvm-svn: 140402
2011-09-23 19:10:26 +00:00
Akira Hatanaka
795050d1d1 Add mips64 & mips64el to Triple. Patch by Liu with modifications.
llvm-svn: 140157
2011-09-20 18:09:37 +00:00
Ted Kremenek
484a96fab1 Add ImmutableMapRef and ImmutableSetRef, which consolidate Immutable[Map,Set] and its Factory. This may eventually replace Immtuable[Map,Set].
llvm-svn: 139967
2011-09-16 23:01:25 +00:00
Douglas Gregor
8c0777c5f3 Add APInt support for converting to/from hexatridecimal strings
llvm-svn: 139695
2011-09-14 15:54:46 +00:00
Tobias Grosser
c6abc36833 Add AMDIL as valid target triple to LLVM.
Submitted by: Villmow, Micah <Micah.Villmow@amd.com>

llvm-svn: 138734
2011-08-29 15:44:55 +00:00
Ivan Krasin
aa3c2057c5 This patch adds support of le32 pseudo-cpu that stands for generic
32-bit little-endian CPU. Used by PNaCl and Emscripten.

llvm-svn: 138335
2011-08-23 16:59:00 +00:00
Jakob Stoklund Olesen
391019be7a Add IntervalMap::const_iterator::atBegin().
It returns true when operator--() can be called.

llvm-svn: 138107
2011-08-19 22:04:19 +00:00
Ivan Krasin
311fcc9b92 Add NativeClient operating system support.
This patch adds support of NativeClient (*-*-nacl) OS support to LLVM.
It's already supported in autoconf/config.sub.

The motivation for this change is to start upstreaming PNaCl work. The
whole set of patches include llvm backends (i686, x86_64, ARM),
llvm-gcc (probably, would not be upstreamed because it's deprecated)
and clang (the work has been just started, the amount of changes is
going to be low and the most of the work is expected to be done close
to the mainline).

llvm-svn: 138005
2011-08-18 22:54:21 +00:00
Chris Lattner
ec2b25406c Fix an obscure bug in PointerUnion that would bite PointerUnion3/4. Basically,
when checking isNull(), we'd pick off the sentinel bit for the outer 
PointerUnion, but would not recursively convert the inner pointerunion to bool,
so if *its* sentinel bit is set, isNull() would incorrectly return false.

No testcase, because someone hit this when they were trying to refactor code
to use PointerUnion3, but they since found a better solution.

llvm-svn: 137428
2011-08-12 04:31:38 +00:00
Andrew Trick
b20e31e81f An interface for iterating over a loop's blocks in DFS order.
llvm-svn: 136838
2011-08-03 23:27:28 +00:00
David Greene
5927323d9c Add a std::string Wrapper for TableGen
Create a std::string wrapper for use as a DenseMap key.  DenseMap is
not safe in generate with strings, so this wrapper indicates that only
strings guaranteed not to have certain values should be used in the
DenseMap.

llvm-svn: 136481
2011-07-29 19:06:58 +00:00
Duncan Sands
beab1f4882 This file was moved from Support to ADT. Correct a comment.
llvm-svn: 136344
2011-07-28 08:36:22 +00:00
Nick Lewycky
31d1c92d69 In DenseMapInfo<pair<T, U>> tombstone key, use the tombstone for T and U instead
of the empty key for U. This shouldn't really matter because the tombstone key
for the pair was still distinct from every other key, but it is odd. Patch by
Michael Ilseman!

llvm-svn: 136336
2011-07-28 06:48:33 +00:00
Ted Kremenek
ee0970dabc Add a generic 'capacity_in_bytes' function to allow inspection of memory usage of various data structures.
llvm-svn: 136233
2011-07-27 18:40:45 +00:00
Duncan Sands
8b264d3264 Strip trailing whitespace.
llvm-svn: 136099
2011-07-26 17:19:30 +00:00
Duncan Sands
0a14a12b51 Teach the Triple class about kfreebsd (FreeBSD kernel with
a GNU userspace).

llvm-svn: 136085
2011-07-26 15:30:04 +00:00
Chris Lattner
489601c923 switch Triple to take twines instead of stringrefs.
llvm-svn: 135889
2011-07-24 20:45:08 +00:00
Chris Lattner
0e3472660b Add Twine support for characters, and switch twine to use a union internally
to eliminate some casting.

llvm-svn: 135888
2011-07-24 20:44:30 +00:00
Frits van Bommel
e238f52543 Omit explicit length here, now that I've had a chance to test this with gcc.
llvm-svn: 135867
2011-07-24 09:53:46 +00:00
Benjamin Kramer
6ab8d85f64 Initialize DenseSets lazily.
llvm-svn: 135717
2011-07-21 23:03:59 +00:00
Chris Lattner
c4ab50bd33 move tier out of an anonymous namespace, it doesn't make sense
to for it to be an an anon namespace and be in a header.

Eliminate some extraenous uses of tie.

llvm-svn: 135669
2011-07-21 06:21:31 +00:00
Jeffrey Yasskin
2e0f2a0985 Add APInt(numBits, ArrayRef<uint64_t> bigVal) constructor to prevent future ambiguity
errors like the one corrected by r135261.  Migrate all LLVM callers of the old
constructor to the new one.

llvm-svn: 135431
2011-07-18 21:45:40 +00:00
Chris Lattner
320e39de40 various cleanups noticed by Frits
llvm-svn: 135396
2011-07-18 16:35:57 +00:00
Chris Lattner
e909e2936b remove pasto
llvm-svn: 135394
2011-07-18 16:04:11 +00:00
Frits van Bommel
107d4e0957 Hopefully fix some GCC-based buildbots. GCC apparently decays the array to a pointer here before overload resolution, so construct with an explicit length instead.
llvm-svn: 135391
2011-07-18 12:31:03 +00:00
Frits van Bommel
9286081ccc Introduce the 'makeArrayRef(...)' family of functions, which fills a similar role for ArrayRef<> as std::make_pair() fills for std::pair<>: they return the right instantiation of ArrayRef<T> based on the types of the parameters.
They mostly mirror the ArrayRef constructors, with two exceptions:
 * There's no function mirroring the default constructor because it wouldn't have any parameters to deduce the right ArrayRef<T> from.
 * There's an explicit SmallVector<T> overload in addition to the SmallVectorImpl<T> overload. Without it, the single-element overload would try to create an ArrayRef<Smallvector<T> > because it's a better match according to the overloading rules. (And both overloads are used in the current tree, so neither is redundant)

llvm-svn: 135389
2011-07-18 11:58:53 +00:00
Chris Lattner
009603a6d2 add iteration support to TinyPtrVector for clang's use.
llvm-svn: 135367
2011-07-18 01:53:11 +00:00
Chris Lattner
04b988a1c0 fix a warning in TinyPtrVector, adopt it in SSAUpdater, saving some
mallocs.

llvm-svn: 135366
2011-07-18 01:43:58 +00:00
Chris Lattner
fde62dcdb7 introduce a new TinyPtrVector class.
llvm-svn: 135365
2011-07-18 01:40:02 +00:00
Jeffrey Yasskin
4d5d3fceaa Add an APFloat::convertToInt(APSInt) function that automatically manages the
memory for the result.

llvm-svn: 135259
2011-07-15 07:04:56 +00:00
Chris Lattner
5bf752bcf4 The key of a StringMap can contain nul's in it, so having first() return
const char* doesn't make sense.  Have it return StringRef instead.

llvm-svn: 135167
2011-07-14 18:31:43 +00:00
Jay Foad
eaccc60d30 Add some bits that I found useful when converting InsertValueInst and
ExtractValueInst APIs to use ArrayRef: a new constructor taking a
(begin, end) range, and operators == and != for element-wise comparison.

llvm-svn: 135039
2011-07-13 09:15:05 +00:00
Owen Anderson
461ad5951b Fix a subtle issue in SmallVector. The following code did not work as expected:
vec.insert(vec.begin(), vec[3]);
The issue was that vec[3] returns a reference into the vector, which is invalidated when insert() memmove's the elements down to make space.  The method needs to specifically detect and handle this case to correctly match std::vector's semantics.

Thanks to Howard Hinnant for clarifying the correct behavior, and explaining how std::vector solves this problem.

llvm-svn: 134554
2011-07-06 22:36:59 +00:00
Nick Lewycky
233eabb210 Add ImmutableList::contains(). Patch by Rui Paulo!
llvm-svn: 134545
2011-07-06 21:59:48 +00:00
Eric Christopher
491e8d6593 Remove the confusing getDarwinNumber() api and friends.
Part of rdar://9714064

llvm-svn: 134291
2011-07-02 00:19:55 +00:00
Douglas Gregor
6ebfe1623c Add initial *-*-rtems* target, from Joel Sherrill
llvm-svn: 134282
2011-07-01 22:41:06 +00:00
Jay Foad
f921ffd79e Extend ConstantUniqueMap with a new template parameter ValRefType,
representing a constant reference to ValType. Normally this is just
"const ValType &", but when ValType is a std::vector we want to use
ArrayRef as the reference type.

llvm-svn: 133611
2011-06-22 08:50:06 +00:00
Jay Foad
6015684974 Remove deprecated forms of StringMap::GetOrCreateValue().
llvm-svn: 133517
2011-06-21 15:37:05 +00:00
Chris Lattner
a9ee8489df use the MapEntryTy typedef instead of writing it out long form,
add some fixme's about methods that should be removed.

Merged from type-system-rewrite.

llvm-svn: 133504
2011-06-21 06:22:33 +00:00
Argyrios Kyrtzidis
81d5aec961 Constify PackedVector::reference::operator T().
llvm-svn: 133074
2011-06-15 19:18:13 +00:00
Ted Kremenek
947d9a7e53 add option for literal formatting to APInt::toString()
toString() now takes an optional bool argument that,
depending on the radix, adds the appropriate prefix
to the integer's string representation that makes it into a
meaningful C literal, e.g.:

hexademical: '-f' becomes '-0xf'
octal: '77' becomes '077'
binary: '110' becomes '0b110'

Patch by nobled@dreamwidth.org!

llvm-svn: 133032
2011-06-15 00:51:55 +00:00
Argyrios Kyrtzidis
e9562b6cbc Introduce PackedVector, useful for storing a vector of values using a specific number of bits for each
value. Both signed and unsigned types can be used, e.g

   PackedVector<signed, 2> vec;

will create a vector accepting values -2, -1, 0, 1. Any other value will hit an assertion.

llvm-svn: 132325
2011-05-31 03:53:41 +00:00
John McCall
645e5b19b7 ...this is not a good commit day for me.
llvm-svn: 132294
2011-05-29 19:44:55 +00:00
John McCall
46c7b963b2 On Darwin ARM, set the UNWIND_RESUME libcall to _Unwind_SjLj_Resume.
This is important for the correct lowering of unwind instructions
(which doesn't matter at all) and llvm.eh.resume calls (which does).

llvm-svn: 132291
2011-05-29 19:39:04 +00:00
Argyrios Kyrtzidis
d58ffb7e7d Add asserts in StringRef to make sure we avoid undefined behavior:
-strlen should not be called with NULL. Also guarantee that StringRef's Length is 0 if Data is NULL.
-memcmp should not be called with NULL (even if size is 0)

Patch by Matthieu Monrocq!

llvm-svn: 131747
2011-05-20 19:24:12 +00:00
Zhongxing Xu
c520c46129 Remove redundant template partial specilization.
llvm-svn: 131402
2011-05-16 12:42:22 +00:00
John McCall
d24d94c11c Add an operator+= for appending StringRefs onto std::strings.
Previously this pattern would be compiled using an implicit conversion
to std::string.

llvm-svn: 131325
2011-05-13 23:58:45 +00:00
Bob Wilson
b718da182d Fix a comment.
llvm-svn: 130761
2011-05-03 17:22:56 +00:00
Lenny Maiorani
1b1a9860d1 Remove bounded StringRef::compare() since nothing but Clang SA was using it and it is just as easy to use StringRef::substr() preceding StringRef::compare() to achieve the same thing.
llvm-svn: 130430
2011-04-28 20:20:12 +00:00
Chandler Carruth
c01a726544 Fix more -Wnon-pod-memset warnings.
llvm-svn: 130392
2011-04-28 08:17:08 +00:00
Ted Kremenek
2cd5c3603f Add utility method to DenseMap to return the amount of memory used for its buckets.
llvm-svn: 130382
2011-04-28 04:52:57 +00:00
Chris Lattner
70762e6755 silence some -Wnon-pod-memset warnings, since std::pair is not POD.
llvm-svn: 130364
2011-04-28 00:55:53 +00:00
Chris Lattner
e2e476dbdd Improve adherence to general style, use "foo_t &x" instead of "foo_t& x"
llvm-svn: 130153
2011-04-25 21:02:12 +00:00
Chris Lattner
75652009a0 allow adding a FoldingSetNodeID to a FastFoldingSetNode, resolving PR9499,
patch by Johannes Schaub!

llvm-svn: 130151
2011-04-25 20:58:50 +00:00
Sebastian Redl
69f3b52528 Give ImmutableIntervalMap.h an include guard.
llvm-svn: 130094
2011-04-24 15:46:46 +00:00
Jay Foad
c146569beb Remove unused STL header includes.
llvm-svn: 130068
2011-04-23 19:53:52 +00:00
Justin Holewinski
dc1965a16c PTX: Add intrinsics to list of built-in intrinsics, which allows them to be
used by Clang.  To help Clang integration, the PTX target has been split
     into two targets: ptx32 and ptx64, depending on the desired pointer size.

- Add GCCBuiltin class to all intrinsics
- Split PTX target into ptx32 and ptx64

llvm-svn: 129851
2011-04-20 15:37:17 +00:00
Daniel Dunbar
82a4062a4e ADT/Triple: Renambe isOSX... methods to isMacOSX for consistency with the OS
triple component.

llvm-svn: 129838
2011-04-20 00:14:25 +00:00
Daniel Dunbar
3f19424547 ADT/Triple: Drop support for -osx style triples, we are going with -macosx
instead.

llvm-svn: 129836
2011-04-19 23:55:20 +00:00
Daniel Dunbar
6af8a09825 ADT/Triple: Add support for Triple::MacOSX per feedback from Chris, will remove
Triple::OSX once Clang has moved.

llvm-svn: 129833
2011-04-19 23:34:12 +00:00
Daniel Dunbar
9934e8436d ADT/Triple: Add isOSDarwin() and isOSWindows() helper functions.
llvm-svn: 129815
2011-04-19 21:12:05 +00:00
Daniel Dunbar
1e1f05faeb ADT/Triple: Add helper function for OS X version checks.
llvm-svn: 129801
2011-04-19 20:30:10 +00:00
Daniel Dunbar
6f283d346f ADT/Triple: Add isOSVersionLT helper function.
llvm-svn: 129800
2011-04-19 20:30:07 +00:00
Daniel Dunbar
e24d3d1bc5 ADT/Triple: Generalize and simplify getDarwinNumber to just be getOSVersion.
llvm-svn: 129799
2011-04-19 20:24:34 +00:00
Daniel Dunbar
ce4e39d010 ADT/Triple: Add support for more explicit "osx" and "ios" OS names.
llvm-svn: 129798
2011-04-19 20:19:27 +00:00
Lenny Maiorani
dfae65d305 Implements StringRef::compare with bounds. It is behaves similarly to strncmp(). Unit tests also included.
llvm-svn: 129582
2011-04-15 17:56:50 +00:00
Chris Lattner
0304b82f80 Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Jay Foad
35b9144371 Fix typo in comment.
llvm-svn: 129436
2011-04-13 12:50:47 +00:00
Chris Lattner
7605c67ada drive by bug fix: DenseMapInfo::isEqual should be determined according to
isEqual of its members, not operator==.

llvm-svn: 129233
2011-04-09 21:20:23 +00:00
Peter Collingbourne
44b69879c2 IntrusiveRefCntPtr: in RefCountedBase and RefCountedBaseVPTR, make
ref_cnt mutable and Retain/Release const to enable reference counted
pointers to const objects

llvm-svn: 128804
2011-04-04 00:57:03 +00:00
Jakob Stoklund Olesen
f881310607 Add an InterferenceCache class for caching per-block interference ranges.
When the greedy register allocator is splitting multiple global live ranges, it
tends to look at the same interference data many times. The InterferenceCache
class caches queries for unaltered LiveIntervalUnions.

llvm-svn: 128764
2011-04-02 06:03:35 +00:00
Jakob Stoklund Olesen
37134e568d Reset StringMap's NumTombstones on clears and rehashes.
StringMap was not properly updating NumTombstones after a clear or rehash.

This was not fatal until now because the table was growing faster than
NumTombstones could, but with the previous change of preventing infinite
growth of the table the invariant (NumItems + NumTombstones <= NumBuckets)
stopped being observed, causing infinite loops in certain situations.

Patch by José Fonseca!

llvm-svn: 128567
2011-03-30 18:32:51 +00:00
Jakob Stoklund Olesen
b4df99dc06 Prevent infinite growth of SmallPtrSet instances.
Rehash but don't grow when full of tombstones.

Patch by José Fonseca!

llvm-svn: 128566
2011-03-30 18:32:48 +00:00
Jakob Stoklund Olesen
0daa5f56cb Prevent infinite growth of SmallMap instances.
Rehash but don't grow when full of tombstones.

Patch by José Fonseca!

llvm-svn: 128565
2011-03-30 18:32:44 +00:00
Jakob Stoklund Olesen
492f97910d Prevent infinite growth of the DenseMap.
When the hash function uses object pointers all free entries eventually
become tombstones as they are used at least once, regardless of the size.

DenseMap cannot function with zero empty keys, so it double size to get
get ridof the tombstones.

However DenseMap never shrinks automatically unless it is cleared, so
the net result is that certain tables grow infinitely.

The solution is to make a fresh copy of the table without tombstones
instead of doubling size, by simply calling grow with the current size.

Patch by José Fonseca!

llvm-svn: 128564
2011-03-30 18:32:41 +00:00
Benjamin Kramer
7888d0935d Add APFloat::getExactInverse.
The idea is, that if an ieee 754 float is divided by a power of two, we can
turn the division into a cheaper multiplication. This function sees if we can
get an exact multiplicative inverse for a divisor and returns it if possible.

This is the hard part of PR9587.

I tested many inputs against llvm-gcc's frotend implementation of this
optimization and didn't find any difference. However, floating point is the
land of weird edge cases, so any review would be appreciated.

llvm-svn: 128545
2011-03-30 15:42:27 +00:00
Jay Foad
770a07e1a3 Fix more zero length memset warnings.
llvm-svn: 128543
2011-03-30 15:31:02 +00:00
Frits van Bommel
c234349939 Constant folding support for calls to umul.with.overflow(), basically identical to the smul.with.overflow() code.
llvm-svn: 128379
2011-03-27 14:26:13 +00:00
Ted Kremenek
a686187713 Relax access control on 'Release' method of RefCountedBase.
llvm-svn: 128054
2011-03-22 01:15:07 +00:00
Ted Kremenek
58a4560569 Allow a client to clear an IntrustiveRefCntPtr (deliberately leaking the referenced object).
llvm-svn: 128007
2011-03-21 18:37:59 +00:00
Argyrios Kyrtzidis
f906dcc618 If a class inherits from RefCountedBaseVPTR allow all its subclasses to be used with IntrusiveRefCntPtr.
llvm-svn: 127966
2011-03-20 06:14:56 +00:00
Benjamin Kramer
a85996c235 Add an argument to APInt's magic udiv calculation to specify the number of bits that are known zero in the divided number.
This will come in handy soon.

llvm-svn: 127828
2011-03-17 20:39:06 +00:00
John Thompson
da294e31da Add scei vendor
llvm-svn: 127705
2011-03-15 21:51:56 +00:00
Duncan Sands
323db6bb99 Often GCC can see that NumBuckets is zero here, resulting in a warning
about possibly swapped memset parameters.  Avoid the warning.

llvm-svn: 127170
2011-03-07 19:38:38 +00:00
Argyrios Kyrtzidis
5a57c82f11 Try fixing mingw build.
llvm-svn: 127153
2011-03-07 05:35:01 +00:00
Argyrios Kyrtzidis
9cd53db2f9 Do a compiler check that we use one of the types from PointerUnion[N], instead of a runtime check.
llvm-svn: 127145
2011-03-07 01:30:20 +00:00
Benjamin Kramer
fbb4be942c Avoid zero-sized allocations when copying a fresh DenseMap.
llvm-svn: 127110
2011-03-05 22:00:28 +00:00
Benjamin Kramer
4861bbca65 Lazily allocate DenseMaps.
This makes lookup slightly more expensive but it's worth it, unused
DenseMaps are common in LLVM code apparently.

1% speedup on clang -O3 bzip2.c
4% speedup on clang -O3 oggenc.c (Release build of clang on i386/linux)

llvm-svn: 127088
2011-03-05 16:43:41 +00:00
Chris Lattner
e82c10f5df add some slice helper methods.
llvm-svn: 126878
2011-03-02 20:55:51 +00:00
Dan Gohman
304de5bc17 Simplify this code.
llvm-svn: 126785
2011-03-01 22:07:32 +00:00
Chris Lattner
7513f07004 add the ability to walk the scope tree and insert at not-the-current
scope.

llvm-svn: 126591
2011-02-27 22:51:57 +00:00
Chris Lattner
3fac41ace4 add a data() method.
llvm-svn: 126590
2011-02-27 22:51:37 +00:00
Daniel Dunbar
d4a7704765 Support: Add llvm::AreStatisticsEnabled().
llvm-svn: 126558
2011-02-26 23:17:12 +00:00
Cameron Zwarich
af4779907f Add a getNumSignBits() method to APInt.
llvm-svn: 126379
2011-02-24 10:00:20 +00:00
Frits van Bommel
68294aa16c Implement TODO for implicit C-array-to-ArrayRef conversion.
llvm-svn: 126311
2011-02-23 13:43:06 +00:00
Nick Lewycky
0c9c9c5beb Fix C++0x incompatibility. The signature of std::make_pair<> changes from:
template <class T1, class T2> pair<T1,T2> make_pair(const T1&, const T2&);
to
  template <class T1, class T2> pair<V1, V2> make_pair(T1&&, T2&&);
so explicitly specifying the template arguments to make_pair<> is going to break
when C++0x rolls through. Replace them with equivalent std::pair<>. Patch by
James Dennett!

llvm-svn: 126256
2011-02-22 22:48:47 +00:00
Argyrios Kyrtzidis
a3437f732e Allow getting the address of the value in a PointerUnion or PointerIntPair if one is
confident enough that he knows what he is doing.

llvm-svn: 126019
2011-02-19 03:55:58 +00:00
Ted Kremenek
cfdacb2104 Add ImmutableMap methods 'manualRetain()', 'manualRelease()', and 'getRootWithoutRetain()' to help more aggressively reclaim memory in the static analyzer.
llvm-svn: 126011
2011-02-19 01:59:21 +00:00
Nadav Rotem
ad2fd4eada Enhance constant folding of bitcast operations on vectors of floats.
Add getAllOnesValue of FP numbers to Constants and APFloat.
Add more tests.

llvm-svn: 125776
2011-02-17 21:22:27 +00:00
NAKAMURA Takumi
00228d0c2c Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 generally.
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32. In llvm side, i686 and x64 can be treated as similar way.

llvm-svn: 125747
2011-02-17 12:24:17 +00:00
Duncan Sands
061150ac1b Spelling fix: consequtive -> consecutive.
llvm-svn: 125563
2011-02-15 09:23:02 +00:00
Chris Lattner
f800339278 fix comments
llvm-svn: 125543
2011-02-15 00:23:53 +00:00
Chris Lattner
0848675c80 fix some typos.
llvm-svn: 125536
2011-02-15 00:06:37 +00:00
Chris Lattner
ee7f7c2494 revert my ConstantVector patch, it seems to have made the llvm-gcc
builders unhappy.

llvm-svn: 125504
2011-02-14 18:15:46 +00:00
Chris Lattner
34f32cb4c2 Switch ConstantVector::get to use ArrayRef instead of a pointer+size
idiom.  Change various clients to simplify their code.

llvm-svn: 125487
2011-02-14 07:55:32 +00:00
Chris Lattner
cf712db15a add a new ArrayRef class. This is intended to replace the idiom we
use in many places where we pass a pointer and size to abstract APIs
that can take C arrays, std::vector, SmallVector, etc.  It is to arrays
what StringRef is to strings.

llvm-svn: 125486
2011-02-14 07:35:09 +00:00
Nick Lewycky
e980f95634 Fix typo in comment.
llvm-svn: 125480
2011-02-14 06:14:20 +00:00
Chris Lattner
307c1d4847 add a helper method.
llvm-svn: 125453
2011-02-13 08:04:16 +00:00
Douglas Gregor
cd73e97a29 Poison the relational operators ==, !=, <, <=, >=, > on llvm::Optional
objects, since they'll end up using the implicit conversion to "bool"
and causing some very "fun" surprises.

llvm-svn: 125380
2011-02-11 18:13:20 +00:00
Dan Gohman
a5cb7ac412 Optimize po_iterator: don't do redundant lookups.
llvm-svn: 125211
2011-02-09 19:25:31 +00:00
Duncan Sands
cfc61f7efb Remove NoVendor and NoOS, added in commit 123990, from Triple. While it
may be useful to understand "none", this is not the place for it.  Tweak
the fix to Normalize while there: the fix added in 123990 works correctly,
but I like this way better.  Finally, now that Triple understands some
non-trivial environment values, teach the unittests about them.

llvm-svn: 124720
2011-02-02 10:08:38 +00:00
Evan Cheng
0e8c521bbd Patches to build EFI with Clang/LLVM. By Carl Norum.
llvm-svn: 124639
2011-02-01 01:14:13 +00:00
Nick Lewycky
8258d2da8c Add DenseSet::resize for API parity with DenseMap::resize.
llvm-svn: 124370
2011-01-27 09:10:42 +00:00
Renato Golin
cf89d692dc Clang was not parsing target triples involving EABI and was generating wrong IR (wrong PCS) and passing the wrong information down llc via the target-triple printed in IR. I've fixed this by adding the parsing of EABI into LLVM's Triple class and using it to choose the correct PCS in Clang's Tools. A Clang patch is on its way to use this infrastructure.
llvm-svn: 123990
2011-01-21 18:25:47 +00:00
Jakob Stoklund Olesen
785d31a2d2 Remove MachineRegisterInfo::getLastVirtReg(), it was giving wrong results
when no virtual registers have been allocated.

It was only used to resize IndexedMaps, so provide an IndexedMap::resize()
method such that

 Map.grow(MRI.getLastVirtReg());

can be replaced with the simpler

 Map.resize(MRI.getNumVirtRegs());

This works correctly when no virtuals are allocated, and it bypasses the to/from
index conversions.

llvm-svn: 123130
2011-01-09 21:58:20 +00:00
Jakob Stoklund Olesen
9a7e67d141 Use IndexedMap for MachineRegisterInfo as well. No functional change.
llvm-svn: 123106
2011-01-09 03:05:46 +00:00
Jakob Stoklund Olesen
b3820cdc22 Use an IndexedMap for LiveOutRegInfo to hide its dependence on TargetRegisterInfo::FirstVirtualRegister.
llvm-svn: 123096
2011-01-08 23:10:50 +00:00
Chris Lattner
c6ccec7faf add a handy typedef.
llvm-svn: 122726
2011-01-03 03:16:20 +00:00
Chris Lattner
c375dcd5f5 really get this working with a custom allocator.
llvm-svn: 122722
2011-01-03 01:38:29 +00:00
Chris Lattner
85f8315219 Enhance ScopedHashTable to allow it to take an allocator argument.
llvm-svn: 122721
2011-01-03 01:29:37 +00:00
Jakob Stoklund Olesen
86786c46c2 Use IntEqClasses to compute connected components of live intervals.
llvm-svn: 122296
2010-12-21 00:48:17 +00:00
Jakob Stoklund Olesen
26b4e8ec0a Add ADT/IntEqClasses.h as a light-weight implementation of EquivalenceClasses.h.
This implementation already exists as ConnectedVNInfoEqClasses in
LiveInterval.cpp, and it seems to be generally useful to have a light-weight way
of forming equivalence classes of small integers.

IntEqClasses doesn't allow enumeration of the elements in a class.

llvm-svn: 122293
2010-12-21 00:04:46 +00:00
Nick Lewycky
de10f6132c Use the new way of silencing this warning.
llvm-svn: 122195
2010-12-19 20:57:14 +00:00