Commit Graph

811 Commits

Author SHA1 Message Date
Jean-Luc Duprat 89fe247094 SmallVector and SmallPtrSet allocations now power-of-two aligned.
This time tested on both OSX and Linux.

llvm-svn: 178377
2013-03-29 22:07:12 +00:00
Rafael Espindola de65751493 Revert "Fix allocations of SmallVector and SmallPtrSet so they are more prone to"
This reverts commit 617330909f0c26a3f2ab8601a029b9bdca48aa61.

It broke the bots:

/home/clangbuild2/clang-ppc64-2/llvm.src/unittests/ADT/SmallVectorTest.cpp:150: PushPopTest
/home/clangbuild2/clang-ppc64-2/llvm.src/unittests/ADT/SmallVectorTest.cpp:118: Failure
Value of: v[i].getValue()
  Actual: 0
Expected: value
Which is: 2

llvm-svn: 178334
2013-03-29 07:11:21 +00:00
Jean-Luc Duprat 67ce1472b4 Fix allocations of SmallVector and SmallPtrSet so they are more prone to
being power-of-two sized.

llvm-svn: 178332
2013-03-29 05:45:22 +00:00
Jyotsna Verma 8542abd762 Disable JIT/MCJIT tests in unittests/ExecutionEngine for the targets that don't support JIT.
llvm-svn: 178221
2013-03-28 03:38:29 +00:00
Evgeniy Stepanov 11820f4bf0 Disable Initialize.MultipleThreads test under MemorySanitizer.
Fails due to insufficient thread stack.

llvm-svn: 178135
2013-03-27 12:50:49 +00:00
Aaron Ballman fcdf9a8240 Test case for graceful handling of long file names on Windows. Patch thanks to Paul Robinson!
llvm-svn: 177223
2013-03-16 15:00:51 +00:00
Michael J. Spencer 01ac34e4c3 [Support][Test] Missed this in the API change.
llvm-svn: 176996
2013-03-14 00:33:37 +00:00
Michael J. Spencer 12e3dfc58e [Support][ErrorOr] Add support for implicit conversion from error code/condition enums.
llvm-svn: 176228
2013-02-28 01:44:26 +00:00
David Blaikie db2c7412e4 Only include move-related Optional<T> tests when rvalue references are available.
llvm-svn: 175730
2013-02-21 07:58:45 +00:00
David Blaikie 1bcb538c3f Add move ctor/assignment to Optional<T>
Code review feedback for r175580 by Jordan Rose.

llvm-svn: 175729
2013-02-21 07:55:39 +00:00
Benjamin Kramer 5c3e21ba55 Move the SplatByte helper to APInt and generalize it a bit.
llvm-svn: 175621
2013-02-20 13:00:06 +00:00
David Blaikie 532aff8cd0 Rename llvm::Optional<T>::Reset to 'reset' as per LLVM naming conventions.
Code review feedback on r175580 from Jordan Rose.

llvm-svn: 175595
2013-02-20 06:25:36 +00:00
David Blaikie 77bac3dbcc Allow llvm::Optional to work with types without default constructors.
This generalizes Optional to require less from the T type by using aligned
storage for backing & placement new/deleting the T into it when necessary.

Also includes unit tests.

llvm-svn: 175580
2013-02-20 00:26:04 +00:00
Douglas Gregor b1c67569c3 Remove my bogus MapVector::erase() with a narrower ::pop_back(), and add a unit test.
llvm-svn: 175538
2013-02-19 18:26:07 +00:00
Meador Inge 32dc724920 ADT: Correct APInt::getActiveWords for zero values
PR15138 was opened because of a segfault in the Bitcode writer.
The actual issue ended up being a bug in APInt where calls to
APInt::getActiveWords returns a bogus value when the APInt value
is 0.  This patch fixes the problem by ensuring that getActiveWords
returns 1 for 0 valued APInts.

llvm-svn: 174641
2013-02-07 18:36:50 +00:00
Michael J. Spencer 18131ae08d [Support][ErrorOr] Add support for convertable types.
Thanks to Andrew, David, and Aaron for helping fix this.

llvm-svn: 174552
2013-02-06 22:28:53 +00:00
Andrew Trick 780ebadc1a Revert "[Support][ErrorOr] Add support for convertable types."
This reverts commit a33e1fafac7fedb1b080ef07ddf9ad6ddff3a830.

This unit test crashes on Darwon. It needs to be temporarily reverted
to unblock the test infrastructure.

llvm-svn: 174458
2013-02-05 22:50:20 +00:00
Michael J. Spencer 31876b4efd [Support][ErrorOr] Add support for convertable types.
llvm-svn: 174357
2013-02-05 08:22:27 +00:00
Dan Gohman 20a2ae9df5 Change GetPointerBaseWithConstantOffset's DataLayout argument from a
reference to a pointer, so that it can handle the case where DataLayout
is not available and behave conservatively.

llvm-svn: 174024
2013-01-31 02:00:45 +00:00
Michael Gottesman 606acb7c85 Added a unit test for r173983 that verifies that Target.isiOS() works correctly.
As a bonus I put in some extra checks to make sure that we are identifying the
machine word of various Mac OS X/iOS targets appropriately.

llvm-svn: 173994
2013-01-30 23:48:13 +00:00
Andrew Kaylor 6d8776a514 Add support for source and line information to IntelJITEventListener for object emitted by MCJIT.
llvm-svn: 173712
2013-01-28 19:52:37 +00:00
Bill Wendling a7a55ee2fc Fix test to not use the AttributeSet's AttributeWithIndex creation method.
llvm-svn: 173608
2013-01-27 03:39:10 +00:00
Dmitri Gribenko c018aadc12 Add file to CMakeLists (file added in r173505)
llvm-svn: 173513
2013-01-25 22:29:23 +00:00
Nick Lewycky 476a6dab9f Add an insert() method to MapVector. Adds the first MapVector unit test.
llvm-svn: 173505
2013-01-25 22:11:02 +00:00
Benjamin Kramer b361adbb64 APFloat: Make sure that we get a well-formed x87 NaN when converting from a smaller type.
Fixes PR15054.

llvm-svn: 173459
2013-01-25 17:01:00 +00:00
NAKAMURA Takumi cbc86bcbb5 unittests/SupportTests/Initialize.MultipleThreads: Enable pthread_attr_setstack(3) only on Linux.
I got blamed on darwin11;
unittests/Support/ManagedStatic.cpp:35: error: 'pthread_attr_setstack' was not declared in this scope

llvm-svn: 173355
2013-01-24 15:29:27 +00:00
NAKAMURA Takumi 2998dcbac5 unittests/SupportTests/Initialize.MultipleThreads: Appease --vg-leak to allocate stack explicitly for glibc.
llvm-svn: 173350
2013-01-24 14:44:02 +00:00
NAKAMURA Takumi 508baf7900 llvm/unittests: Use OwningPtr to fix --vg-leak.
llvm-svn: 173240
2013-01-23 08:33:13 +00:00
NAKAMURA Takumi 6d951b7cff IRTests/WaymarkTest.cpp: Fix in --vg-leak.
llvm-svn: 173239
2013-01-23 08:33:05 +00:00
NAKAMURA Takumi d86cd7855b IRTests/IRBuilderTest.cpp: GetIntTy: Delete DL at yourself since it is not linked.
llvm-svn: 173238
2013-01-23 08:31:28 +00:00
NAKAMURA Takumi 7493658645 IRTests/IRBuilderTest.cpp: Let GV added to the module.
It fixes --vg-leak.

llvm-svn: 173237
2013-01-23 08:30:39 +00:00
NAKAMURA Takumi 0c8f08d305 IRTests/ConstantsTest.cpp: AsInstructionsTest: Delete each instruction immediately if it is not linked.
llvm-svn: 173236
2013-01-23 08:30:26 +00:00
NAKAMURA Takumi 773f74cb10 Untabify.
llvm-svn: 173235
2013-01-23 08:30:21 +00:00
NAKAMURA Takumi 07d2f3fb79 Whitespace.
llvm-svn: 173234
2013-01-23 08:30:15 +00:00
NAKAMURA Takumi afda71e911 DominatorTreeTest.cpp: Add the file header.
llvm-svn: 173233
2013-01-23 08:30:10 +00:00
Michael J. Spencer f71baa84ea [Support][ErrorOr] Add optimized specialization of ErrorOr<void>.
ErrorOr<void> represents an operation that returns nothing, but can still fail.
It should be used in cases where you need the aditional user data that ErrorOr
provides over error_code.

llvm-svn: 173209
2013-01-23 00:18:31 +00:00
NAKAMURA Takumi 6c03b6d005 ADT/SparseMultiSetTest.cpp: Try to appease cygwin-clang on stage2, take two. [-Wsign-compare]
llvm-svn: 173144
2013-01-22 10:39:31 +00:00
NAKAMURA Takumi 90c45fcaa6 ADT/SparseMultiSetTest.cpp: Try to appease cygwin-clang (libstdc++-4.5) on stage2. [-Wsign-compare]
llvm-svn: 173127
2013-01-22 05:30:15 +00:00
NAKAMURA Takumi 08e028e194 ErrorOrTest.cpp: Check existence of EXPECT_DEBUG_DEATH. It is not always available.
llvm-svn: 173123
2013-01-22 04:02:41 +00:00
Michael Ilseman 3e3194f4ec Introduce a new data structure, the SparseMultiSet, and changes to the MI scheduler to use it.
A SparseMultiSet adds multiset behavior to SparseSet, while retaining SparseSet's desirable properties. Essentially, SparseMultiSet provides multiset behavior by storing its dense data in doubly linked lists that are inlined into the dense vector. This allows it to provide good data locality as well as vector-like constant-time clear() and fast constant time find(), insert(), and erase(). It also allows SparseMultiSet to have a builtin recycler rather than keeping SparseSet's behavior of always swapping upon removal, which allows it to preserve more iterators. It's often a better alternative to a SparseSet of a growable container or vector-of-vector.

llvm-svn: 173064
2013-01-21 18:18:53 +00:00
Michael J. Spencer b21371018c [Support] Make test C++03.
llvm-svn: 173004
2013-01-21 05:39:07 +00:00
Benjamin Kramer 135658f4bc Disable test that fails due to lack of std::true_type in C++03.
Michael, can this test be ported to C++03?

llvm-svn: 172996
2013-01-20 21:52:27 +00:00
Michael J. Spencer 779c4247f7 [Support] Port ErrorOr<T> from lld to C++03.
llvm-svn: 172991
2013-01-20 20:32:30 +00:00
Peter Collingbourne a51c6ed608 Introduce llvm::sys::getProcessTriple() function.
In r143502, we renamed getHostTriple() to getDefaultTargetTriple()
as part of work to allow the user to supply a different default
target triple at configure time.  This change also affected the JIT.
However, it is inappropriate to use the default target triple in the
JIT in most circumstances because this will not necessarily match
the current architecture used by the process, leading to illegal
instruction and other such errors at run time.

Introduce the getProcessTriple() function for use in the JIT and
its clients, and cause the JIT to use it.  On architectures with a
single bitness, the host and process triples are identical.  On other
architectures, the host triple represents the architecture of the
host CPU, while the process triple represents the architecture used
by the host CPU to interpret machine code within the current process.
For example, when executing 32-bit code on a 64-bit Linux machine,
the host triple may be 'x86_64-unknown-linux-gnu', while the process
triple may be 'i386-unknown-linux-gnu'.

This fixes JIT for the 32-on-64-bit (and vice versa) build on non-Apple
platforms.

Differential Revision: http://llvm-reviews.chandlerc.com/D254

llvm-svn: 172627
2013-01-16 17:27:22 +00:00
Evgeniy Stepanov 2338264ad9 Allow vectors in CreatePointerCast of constants.
llvm-svn: 172615
2013-01-16 14:41:46 +00:00
Evgeniy Stepanov a259b26c50 A test for r172535.
llvm-svn: 172614
2013-01-16 14:38:50 +00:00
Dmitri Gribenko fb37aca9d5 Improve r172464: const_cast is not needed if the variable is not const
llvm-svn: 172474
2013-01-14 21:23:37 +00:00
David Greene 4c66a58b64 Fix Casts
Use const_cast<> to avoid cast-away-const errors.

llvm-svn: 172464
2013-01-14 21:04:35 +00:00
Benjamin Kramer 410780b82c Add a unit test to verifies that attribute uniquing works so it doesn't break again.
The folding set details can be subtle and broke twice in the last couple of weeks.

llvm-svn: 172313
2013-01-12 14:13:45 +00:00
Eli Bendersky 738fbca845 Fix bug in exception table allocation (PR13678)
Patch by Michael Muller.

llvm-svn: 172214
2013-01-11 16:33:30 +00:00