Commit Graph

1418 Commits

Author SHA1 Message Date
Chandler Carruth
a602aec869 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146732 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 09:36:16 +00:00
Chandler Carruth
d916ce3c8e 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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146729 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 08:58:59 +00:00
Tony Linthicum
b4b54153ad Hexagon backend support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146412 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 21:14:40 +00:00
Michael J. Spencer
a81ac8f2b5 Support/FileSystem: Implement recursive_directory_iterator and make
directory_iterator preserve InputIterator semantics on copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146200 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 22:50:09 +00:00
David Blaikie
5729c5848c Adding missing anchor to DATDeltaAlgorithm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146025 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 06:44:23 +00:00
Chris Lattner
266451dd95 allow TinyPtrVector to implicitly convert to ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145898 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-06 02:00:33 +00:00
Nick Lewycky
aa21e417f2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145869 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05 23:07:05 +00:00
Anna Zaks
e15402f92b 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145837 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-05 19:17:04 +00:00
Benjamin Kramer
39a2eb7dea Handle more cases in APInt::getLowBitsSet's fast path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145249 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-28 16:56:38 +00:00
Ted Kremenek
f249449539 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144931 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-17 23:02:14 +00:00
Benjamin Kramer
5908536673 Replace (Lower|Upper)caseString in favor of StringRef's newest methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143891 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-06 20:37:06 +00:00
Daniel Dunbar
589fbb1770 ADT/StringRef: Add ::lower() and ::upper() methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143880 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-06 18:04:43 +00:00
Dan Gohman
33ba8b0e96 Remove the Alpha backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143164 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-27 22:56:32 +00:00
Dan Gohman
3e6157de57 Remove the Blackfin backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142880 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-25 00:05:42 +00:00
Dan Gohman
29074ccf6c Remove the SystemZ backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142878 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-24 23:48:32 +00:00
Duncan Sands
f6eede5258 Avoid warnings about the parameter G being unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142573 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-20 08:56:41 +00:00
Eli Friedman
a046d2ff9a 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141827 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-12 22:25:45 +00:00
Andrew Trick
8cc4769108 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141574 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 19:48:56 +00:00
Andrew Trick
b35e4e8472 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141572 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 19:35:46 +00:00
Ted Kremenek
4f101db885 Make canonicalization of ImmutableSetRef::asImmutableSet() semi-explicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140959 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 01:47:07 +00:00
Anna Zaks
b3e3b006bd Add getTreeFactory() to ImmutableSet to allow construction of ImmutableSetRef from an ImmutableSet object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140402 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 19:10:26 +00:00
Akira Hatanaka
70303688bc Add mips64 & mips64el to Triple. Patch by Liu with modifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140157 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 18:09:37 +00:00
Ted Kremenek
166e0539c9 Add ImmutableMapRef and ImmutableSetRef, which consolidate Immutable[Map,Set] and its Factory. This may eventually replace Immtuable[Map,Set].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139967 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-16 23:01:25 +00:00
Douglas Gregor
dcd9996241 Add APInt support for converting to/from hexatridecimal strings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139695 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 15:54:46 +00:00
Tobias Grosser
05d7138018 Add AMDIL as valid target triple to LLVM.
Submitted by: Villmow, Micah <Micah.Villmow@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138734 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-29 15:44:55 +00:00
Ivan Krasin
38fb2db6c9 This patch adds support of le32 pseudo-cpu that stands for generic
32-bit little-endian CPU. Used by PNaCl and Emscripten.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138335 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23 16:59:00 +00:00
Jakob Stoklund Olesen
cafe614035 Add IntervalMap::const_iterator::atBegin().
It returns true when operator--() can be called.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138107 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-19 22:04:19 +00:00
Ivan Krasin
fb23462889 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).




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138005 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 22:54:21 +00:00
Chris Lattner
823eb1ca11 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137428 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 04:31:38 +00:00
Andrew Trick
5207936a24 An interface for iterating over a loop's blocks in DFS order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136838 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03 23:27:28 +00:00
David Greene
cd0bc905d2 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136481 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-29 19:06:58 +00:00
Duncan Sands
4ed960061a This file was moved from Support to ADT. Correct a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136344 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-28 08:36:22 +00:00
Nick Lewycky
297738fa95 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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136336 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-28 06:48:33 +00:00
Ted Kremenek
18dceba0bb Add a generic 'capacity_in_bytes' function to allow inspection of memory usage of various data structures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136233 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-27 18:40:45 +00:00
Duncan Sands
b08904093a Strip trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136099 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-26 17:19:30 +00:00
Duncan Sands
652b48bf23 Teach the Triple class about kfreebsd (FreeBSD kernel with
a GNU userspace).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136085 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-26 15:30:04 +00:00
Chris Lattner
b7fbcc9696 switch Triple to take twines instead of stringrefs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135889 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-24 20:45:08 +00:00
Chris Lattner
3f25ee080c Add Twine support for characters, and switch twine to use a union internally
to eliminate some casting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135888 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-24 20:44:30 +00:00
Frits van Bommel
f627530999 Omit explicit length here, now that I've had a chance to test this with gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135867 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-24 09:53:46 +00:00
Benjamin Kramer
5333658df7 Initialize DenseSets lazily.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135717 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-21 23:03:59 +00:00
Chris Lattner
c30a38f34b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135669 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-21 06:21:31 +00:00
Jeffrey Yasskin
3ba292dbc2 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135431 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 21:45:40 +00:00
Chris Lattner
22e522e086 various cleanups noticed by Frits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135396 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 16:35:57 +00:00
Chris Lattner
1419f9206e remove pasto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135394 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 16:04:11 +00:00
Frits van Bommel
b80e3477d1 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135391 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 12:31:03 +00:00
Frits van Bommel
c48e1ef0e2 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135389 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 11:58:53 +00:00
Chris Lattner
79976a4072 add iteration support to TinyPtrVector for clang's use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135367 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 01:53:11 +00:00
Chris Lattner
840635741f fix a warning in TinyPtrVector, adopt it in SSAUpdater, saving some
mallocs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135366 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 01:43:58 +00:00
Chris Lattner
9d69d4aadd introduce a new TinyPtrVector class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135365 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 01:40:02 +00:00
Jeffrey Yasskin
3d42bfbbdd Add an APFloat::convertToInt(APSInt) function that automatically manages the
memory for the result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135259 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 07:04:56 +00:00
Chris Lattner
d7c027322e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135167 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14 18:31:43 +00:00
Jay Foad
5d4f9909c4 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135039 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 09:15:05 +00:00
Owen Anderson
9cbd7afb76 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134554 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 22:36:59 +00:00
Nick Lewycky
298bc9a1a5 Add ImmutableList::contains(). Patch by Rui Paulo!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134545 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 21:59:48 +00:00
Eric Christopher
4d59ff95d8 Remove the confusing getDarwinNumber() api and friends.
Part of rdar://9714064


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134291 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 00:19:55 +00:00
Douglas Gregor
6ced1d12dd Add initial *-*-rtems* target, from Joel Sherrill
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134282 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 22:41:06 +00:00
Jay Foad
2a4a6fecf0 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133611 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 08:50:06 +00:00
Jay Foad
e275c1c9b5 Remove deprecated forms of StringMap::GetOrCreateValue().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133517 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 15:37:05 +00:00
Chris Lattner
39ff10a293 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133504 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 06:22:33 +00:00
Argyrios Kyrtzidis
9fa7cb1ba6 Constify PackedVector::reference::operator T().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133074 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-15 19:18:13 +00:00
Ted Kremenek
cf886188fb 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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133032 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-15 00:51:55 +00:00
Argyrios Kyrtzidis
74ee8ace0c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132325 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-31 03:53:41 +00:00
John McCall
fe754ab90a ...this is not a good commit day for me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132294 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-29 19:44:55 +00:00
John McCall
832a9d1a76 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).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132291 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-29 19:39:04 +00:00
Argyrios Kyrtzidis
6d5502eb49 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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131747 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-20 19:24:12 +00:00
Zhongxing Xu
aea7689e62 Remove redundant template partial specilization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131402 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 12:42:22 +00:00
John McCall
6765f78efb Add an operator+= for appending StringRefs onto std::strings.
Previously this pattern would be compiled using an implicit conversion
to std::string.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131325 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-13 23:58:45 +00:00
Bob Wilson
6e97eced2f Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130761 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 17:22:56 +00:00
Lenny Maiorani
6cf081cbe5 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130430 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 20:20:12 +00:00
Chandler Carruth
776157ac92 Fix more -Wnon-pod-memset warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130392 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 08:17:08 +00:00
Ted Kremenek
e6b693db8c Add utility method to DenseMap to return the amount of memory used for its buckets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130382 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 04:52:57 +00:00
Chris Lattner
450ed1a05b silence some -Wnon-pod-memset warnings, since std::pair is not POD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130364 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 00:55:53 +00:00
Chris Lattner
6311a55b9d Improve adherence to general style, use "foo_t &x" instead of "foo_t& x"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130153 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 21:02:12 +00:00
Chris Lattner
e27c3ea2bc allow adding a FoldingSetNodeID to a FastFoldingSetNode, resolving PR9499,
patch by Johannes Schaub!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130151 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 20:58:50 +00:00
Sebastian Redl
f462ab431f Give ImmutableIntervalMap.h an include guard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130094 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 15:46:46 +00:00
Jay Foad
ddcdcc8863 Remove unused STL header includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130068 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-23 19:53:52 +00:00
Justin Holewinski
e1fee48cd0 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129851 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 15:37:17 +00:00
Daniel Dunbar
558692fd0a ADT/Triple: Renambe isOSX... methods to isMacOSX for consistency with the OS
triple component.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129838 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 00:14:25 +00:00
Daniel Dunbar
398a5ca9cd ADT/Triple: Drop support for -osx style triples, we are going with -macosx
instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129836 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 23:55:20 +00:00
Daniel Dunbar
1af394766f ADT/Triple: Add support for Triple::MacOSX per feedback from Chris, will remove
Triple::OSX once Clang has moved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129833 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 23:34:12 +00:00
Daniel Dunbar
e1fe09f682 ADT/Triple: Add isOSDarwin() and isOSWindows() helper functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129815 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 21:12:05 +00:00
Daniel Dunbar
4860fe0ad0 ADT/Triple: Add helper function for OS X version checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129801 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 20:30:10 +00:00
Daniel Dunbar
8974153870 ADT/Triple: Add isOSVersionLT helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129800 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 20:30:07 +00:00
Daniel Dunbar
087d6a59ad ADT/Triple: Generalize and simplify getDarwinNumber to just be getOSVersion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129799 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 20:24:34 +00:00
Daniel Dunbar
0dde4c00ee ADT/Triple: Add support for more explicit "osx" and "ios" OS names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129798 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 20:19:27 +00:00
Lenny Maiorani
437ef0cfb7 Implements StringRef::compare with bounds. It is behaves similarly to strncmp(). Unit tests also included.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129582 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-15 17:56:50 +00:00
Chris Lattner
7a2bdde0a0 Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-15 05:18:47 +00:00
Jay Foad
715c80a00b Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129436 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-13 12:50:47 +00:00
Chris Lattner
b1145c8cee drive by bug fix: DenseMapInfo::isEqual should be determined according to
isEqual of its members, not operator==.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129233 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 21:20:23 +00:00
Peter Collingbourne
10fdd5a0f6 IntrusiveRefCntPtr: in RefCountedBase and RefCountedBaseVPTR, make
ref_cnt mutable and Retain/Release const to enable reference counted
pointers to const objects

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128804 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-04 00:57:03 +00:00
Jakob Stoklund Olesen
5907d86365 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128764 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-02 06:03:35 +00:00
Jakob Stoklund Olesen
03ef449917 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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128567 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 18:32:51 +00:00
Jakob Stoklund Olesen
e10fff6f88 Prevent infinite growth of SmallPtrSet instances.
Rehash but don't grow when full of tombstones.

Patch by José Fonseca!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128566 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 18:32:48 +00:00
Jakob Stoklund Olesen
aea4fe2862 Prevent infinite growth of SmallMap instances.
Rehash but don't grow when full of tombstones.

Patch by José Fonseca!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128565 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 18:32:44 +00:00
Jakob Stoklund Olesen
414fdbdb01 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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128564 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 18:32:41 +00:00
Benjamin Kramer
2746000f4f 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128545 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 15:42:27 +00:00
Jay Foad
d01f2633b9 Fix more zero length memset warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128543 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 15:31:02 +00:00
Frits van Bommel
6208610fd6 Constant folding support for calls to umul.with.overflow(), basically identical to the smul.with.overflow() code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128379 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-27 14:26:13 +00:00
Ted Kremenek
116e2348ed Relax access control on 'Release' method of RefCountedBase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128054 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 01:15:07 +00:00
Ted Kremenek
47f0f1856f Allow a client to clear an IntrustiveRefCntPtr (deliberately leaking the referenced object).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128007 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 18:37:59 +00:00