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

501 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith
8456fa3c41 ADT: Allow up to 18 arguments in hash_combine()
I just realized that the specialized metadata node patch I'm about to
commit won't compile on old compilers.  Bump `hash_combine()`'s support
for non-variadic templates to 18 (I tested this by reversing the logic
in the #ifdef).

llvm-svn: 228629
2015-02-09 23:21:05 +00:00
Benjamin Kramer
28fba477c6 SmallVector: Move emplace_back to SmallVectorImpl.
This resolves the strange effect that emplace_back is only available
when the type contained in the vector is not trivially copyable.

llvm-svn: 228496
2015-02-07 16:41:02 +00:00
Duncan P. N. Exon Smith
7f33c007a0 ADT: Add int64_t interoperability to APSInt
Add some API to `APSInt` to make it easier to compare with `int64_t`.

  - `APSInt::compareValues(APSInt, APSInt)` returns 1, -1 or 0 for
    greater, lesser, or equal, doing the right thing for mismatched
    "has-sign" and bitwidths.  This is just like `isSameValue()` (and is
    now the implementation of it).
  - `APSInt::get(int64_t)` gets a signed `APSInt`.
  - `operator<(int64_t)`, etc., are implemented trivially via `get()`
    and `compareValues()`.
  - Also added `APSInt::getUnsigned(uint64_t)` to make it easier to test
    `compareValues()`.

llvm-svn: 228239
2015-02-05 00:17:43 +00:00
Joerg Sonnenberger
d482228a3f The canonical CPU variant for ARM according to config.guess uses a
suffix it seems:

    # ./config.guess
    earmv7hfeb-unknown-netbsd7.99.4

Extend the triple parsing to support this. Avoid running the ARM parser
multiple times because StringSwitch is not lazy.

Reviewers: Renato Golin, Tim Northover

Differential Revision: http://reviews.llvm.org/D7166

llvm-svn: 227085
2015-01-26 11:41:48 +00:00
Lang Hames
25dc17847a [ADT] Add move operations to SmallVector<T,N> from SmallVectorImpl<T>.
This makes it possible to move between SmallVectors of different sizes.

Thanks to Dave Blaikie and Duncan Smith for patch feedback.

llvm-svn: 226899
2015-01-23 06:25:17 +00:00
Michael Gottesman
5abf238495 [tinyptrvector] Add in a MutableArrayRef implicit conversion operator to complement the ArrayRef implicit conversion operator.
llvm-svn: 226428
2015-01-19 03:25:33 +00:00
Richard Trieu
d6743940e6 Disable -Wunknown-pragmas in a test so that Clang without -Wself-move will not
complain that the flag doesn't exist.

llvm-svn: 225931
2015-01-14 01:50:12 +00:00
Aaron Ballman
ed32ba7ebd Silence warnings about unknown pragmas for compilers that are not Clang. NFC.
llvm-svn: 225788
2015-01-13 14:30:07 +00:00
Richard Trieu
499c1ba6e9 Disable a warning for self move since the test is checking for this behavior.
llvm-svn: 225754
2015-01-13 02:10:33 +00:00
Lang Hames
edc98a62db [APFloat][ADT] Fix sign handling logic for FMA results that truncate to zero.
This patch adds a check for underflow when truncating results back to lower
precision at the end of an FMA. The additional sign handling logic in
APFloat::fusedMultiplyAdd should only be performed when the result of the
addition step of the FMA (in full precision) is exactly zero, not when the
result underflows to zero.

Unit tests for this case and related signed zero FMA results are included.

Fixes <rdar://problem/18925551>.

llvm-svn: 225123
2015-01-04 01:20:55 +00:00
Chandler Carruth
d5912b0090 Revert r225053: Add an ArrayRef upcasting constructor from ArrayRef<U*> -> ArrayRef<T*> where T is a base of U.
This appears to have broken at least the windows build bots due to
compile errors in the predicate that didn't simply supress the overload.
I'm not sure what the fix is, and the bots have been broken for a long
time now so I'm just reverting until Michael can figure out a fix.

llvm-svn: 225064
2015-01-01 13:01:25 +00:00
Michael Gottesman
2c8ecfdec0 Add 2x constructors for TinyPtrVector, one that takes in one elemenet and the other that takes in an ArrayRef<EltTy>
Currently one can only construct an empty TinyPtrVector. These are just missing
elements of the API.

llvm-svn: 225055
2014-12-31 23:33:24 +00:00
Michael Gottesman
b2e01905b0 Add a SmallMapVector class that is a MapVector with a Map of SmallDenseMap and a Vector of SmallVector.
llvm-svn: 225054
2014-12-31 23:33:21 +00:00
Michael Gottesman
166915c263 Add an ArrayRef upcasting constructor from ArrayRef<U*> -> ArrayRef<T*> where T is a base of U.
llvm-svn: 225053
2014-12-31 23:33:18 +00:00
Aaron Ballman
6dbe89c5fb Silencing several "multiple copy constructors" warnings from MSVC; NFC.
llvm-svn: 223238
2014-12-03 14:44:16 +00:00
Duncan P. N. Exon Smith
27a4458649 ADT: Add SmallVector<>::emplace_back()
llvm-svn: 223201
2014-12-03 04:45:09 +00:00
Michael Ilseman
970e7c5fb1 Compilation test for PostOrderIterator.
If the template specialization for externally managed sets in
PostOrderIterator call too far out of sync with each other, this unit
test will fail to build. This is especially useful for developers who
may not build Clang (the only in-tree user) every time.

llvm-svn: 222447
2014-11-20 19:33:33 +00:00
Lang Hames
2082c9d610 [ADT] Fix PR20728 - Incorrect APFloat::fusedMultiplyAdd results for x86_fp80.
As detailed at http://llvm.org/PR20728, due to an internal overflow in
APFloat::multiplySignificand the APFloat::fusedMultiplyAdd method can return
incorrect results for x87DoubleExtended (x86_fp80) values. This commonly
manifests as incorrect constant folding of libm fmal calls on x86. E.g.

fmal(1.0L, 1.0L, 3.0L) == 0.0L      (should be 4.0L)

This patch fixes PR20728 by adding an extra bit to the significand for
intermediate results of APFloat::multiplySignificand, avoiding the overflow.

llvm-svn: 222374
2014-11-19 19:15:41 +00:00
David Blaikie
7499cbae4c Remove StringMap::GetOrCreateValue in favor of StringMap::insert
Having two ways to do this doesn't seem terribly helpful and
consistently using the insert version (which we already has) seems like
it'll make the code easier to understand to anyone working with standard
data structures. (I also updated many references to the Entry's
key and value to use first() and second instead of getKey{Data,Length,}
and get/setValue - for similar consistency)

Also removes the GetOrCreateValue functions so there's less surface area
to StringMap to fix/improve/change/accommodate move semantics, etc.

llvm-svn: 222319
2014-11-19 05:49:42 +00:00
David Blaikie
5d50f1a98a StringMap: Test and finish off supporting perfectly forwarded values in StringMap operations.
Followup to r221946.

llvm-svn: 221958
2014-11-14 00:41:46 +00:00
David Blaikie
f9f5076648 Ensure function_refs are copyable even from non-const references
A subtle bug was found where attempting to copy a non-const function_ref
lvalue would actually invoke the generic forwarding constructor (as it
was a closer match - being T& rather than the const T& of the implicit
copy constructor). In the particular case this lead to a dangling
function_ref member (since it had referenced the function_ref passed by
value to its ctor, rather than the outer function_ref that was still
alive)

SFINAE the converting constructor to not be considered if the copy
constructor is available and demonstrate that this causes the copy to
refer to the original functor, not to the function_ref it was copied
from. (without the code change, the test would fail as Y would be
referencing X and Y() would see the result of the mutation to X, ie: 2)

llvm-svn: 221753
2014-11-12 02:06:08 +00:00
Michael Gottesman
d4b999b2da Add MapVector::rbegin(), MapVector::rend() to completment MapVector::begin(), MapVector::end().
These just delegate to the underlying vector type in the MapVector.

Also just add in some sanity unittests.

llvm-svn: 220687
2014-10-27 17:20:53 +00:00
Lang Hames
9793d69437 [ADT] Add a 'find_as' operation to DenseSet.
This operation is analogous to its counterpart in DenseMap: It allows lookup
via cheap-to-construct keys (provided that getHashValue and isEqual are
implemented for the cheap key-type in the DenseMapInfo specialization).

Thanks to Chandler for the review.

llvm-svn: 220168
2014-10-19 19:36:33 +00:00
Chandler Carruth
2a55c85b24 [ADT] Add an (ADL-friendly) abs free function for APFloat that returns
by value having cleared the sign bit.

llvm-svn: 219485
2014-10-10 08:27:22 +00:00
Matt Arsenault
09219bef3e Add minnum / maxnum to APFloat
llvm-svn: 219475
2014-10-10 05:21:32 +00:00
Chandler Carruth
f0786b5838 [ADT] Replace the logb implementation with the simpler and much closer
to what we actually want ilogb implementation. This makes everything
*much* easier to deal with and is actually what we want when using it
anyways.

llvm-svn: 219474
2014-10-10 05:14:12 +00:00
Chandler Carruth
e6b432108a [ADT] Add the scalbn function for APFloat.
llvm-svn: 219473
2014-10-10 04:54:30 +00:00
Chandler Carruth
fc0c6a60f7 [ADT] Implement the 'logb' functionality for APFloat. This is necessary
to implement complex division in the constant folder of Clang.

llvm-svn: 219471
2014-10-10 04:17:04 +00:00
Chandler Carruth
9274f76fc2 [ADT] Add basic operator overloads for arithmetic to APFloat to make
code using it more readable.

Also add a copySign static function that works more like the standard
function by accepting the value and sign-carying value as arguments.

No interesting logic here, but tests added to cover the basic API
additions and make sure they do something plausible.

llvm-svn: 219453
2014-10-09 23:26:15 +00:00
Kaelyn Takata
3a59730bde Add return value and negative checks to MapVector::erase from r219240.
llvm-svn: 219250
2014-10-07 23:11:49 +00:00
Kaelyn Takata
6c182edff1 Add size_t MapVector::erase(KeyT) similar to the one in std::map.
llvm-svn: 219240
2014-10-07 21:15:51 +00:00
David Blaikie
abe7833c2f Update test name to match changes made in r218783
Addressing post commit review feedback from Justin Bogner.

llvm-svn: 218821
2014-10-01 21:19:39 +00:00
David Blaikie
7b8bbd0e46 Add an immovable type to test Optional<T>::emplace more rigorously after r218732.
llvm-svn: 218783
2014-10-01 18:29:44 +00:00
NAKAMURA Takumi
db6522181c ADTTests/OptionalTest.cpp: Use LLVM_DELETED_FUNCTION.
llvm-svn: 218750
2014-10-01 09:14:43 +00:00
Jordan Rose
9f866eaf0a Add an emplace(...) method to llvm::Optional<T>.
This can be used for in-place initialization of non-moveable types.
For compilers that don't support variadic templates, only up to four
arguments are supported. We can always add more, of course, but this
should be good enough until we move to a later MSVC that has full
support for variadic templates.

Inspired by std::experimental::optional from the "Library Fundamentals" C++ TS.
Reviewed by David Blaikie.

llvm-svn: 218732
2014-10-01 02:12:35 +00:00
Jordan Rose
546768112a Add getValueOr to llvm::Optional<T>.
This takes a single argument convertible to T, and
- if the Optional has a value, returns the existing value,
- otherwise, constructs a T from the argument and returns that.

Inspired by std::experimental::optional from the "Library Fundamentals" C++ TS.

llvm-svn: 218618
2014-09-29 18:56:08 +00:00
Matt Arsenault
62b3e7bfd0 Add hsail and amdil64 to Triple
llvm-svn: 218142
2014-09-19 19:52:11 +00:00
Ed Maste
98616ed207 Add unit test for r217454
llvm-svn: 217786
2014-09-15 16:57:12 +00:00
David Blaikie
aa3930b088 Add some negative (and positive) static_assert checks for ArrayRef-of-pointer conversions introduced in r216709
llvm-svn: 216830
2014-08-31 01:33:41 +00:00
Craig Topper
dc6431e879 Add a test for converting ArrayRef<T *> to ArrayRef<const T *>.
llvm-svn: 216821
2014-08-30 16:48:19 +00:00
Craig Topper
43cee2f5fc Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created.
llvm-svn: 216525
2014-08-27 05:25:25 +00:00
Duncan P. N. Exon Smith
119044acf4 ADT: Unit test for ArrayRef::equals change in r215986
llvm-svn: 216008
2014-08-19 19:18:46 +00:00
David Blaikie
e490f547d3 Fix -Wsign-compare warnings
llvm-svn: 215483
2014-08-12 23:23:05 +00:00
Reid Kleckner
3f1f5c1808 APInt: Make self-move-assignment a no-op to fix stage3 clang-cl
It's not clear what the semantics of a self-move should be.  The
consensus appears to be that a self-move should leave the object in a
moved-from state, which is what our existing move assignment operator
does.

However, the MSVC 2013 STL will perform self-moves in some cases.  In
particular, when doing a std::stable_sort of an already sorted APSInt
vector of an appropriate size, one of the merge steps will self-move
half of the elements.

We don't notice this when building with MSVC, because MSVC will not
synthesize the move assignment operator for APSInt.  Presumably MSVC
does this because APInt, the base class, has user-declared special
members that implicitly delete move special members.  Instead, MSVC
selects the copy-assign operator, which defends against self-assignment.
Clang, on the other hand, selects the move-assign operator, and we get
garbage APInts.

llvm-svn: 215478
2014-08-12 22:01:39 +00:00
Saleem Abdulrasool
92b98299b9 ADT: remove MinGW32 and Cygwin OSType enum
Remove the MinGW32 and Cygwin types from the OSType enumeration.  These values
are represented via environments of Windows.  It is a source of confusion and
needlessly clutters the code.  The cost of doing this is that we must sink the
check for them into the normalization code path along with the spelling.

Addresses PR20592.

llvm-svn: 215303
2014-08-09 23:12:20 +00:00
Andrew Trick
f644021551 Fix SmallDenseMap assignment operator.
Self assignment would lead to buckets of garbage, causing quadratic probing to hang.

llvm-svn: 214790
2014-08-04 22:18:25 +00:00
Chandler Carruth
869b0d1406 [ADT] Add a remarkbly useful little helper routine to ArrayRef for
checking whether the ArrayRef is equal to an explicit list of arguments.

This is particularly easy to implement even without variadic templates
because ArrayRef happens to be homogeneously typed. As a consequence we
can use a "clever" wrapper type and default arguments to capture in
a single method many arguments as well as *how many* arguments the user
specified.

Thanks to Dave Blaikie for helping me pull together this little helper.
Suggestions for how to improve or generalize it are of course welcome.
I'll be using it immediately in my follow-up patch. =D

llvm-svn: 214041
2014-07-27 01:11:19 +00:00
Duncan P. N. Exon Smith
920db48687 ADT: Add MapVector::remove_if
Add a `MapVector::remove_if()` that erases items in bulk in linear time,
as opposed to quadratic time for repeated calls to `MapVector::erase()`.

llvm-svn: 213090
2014-07-15 20:24:56 +00:00
Duncan P. N. Exon Smith
d7051f69aa ADT: Fix MapVector::erase()
Actually update the changed indexes in the map portion of `MapVector`
when erasing from the middle.  Add a unit test that checks for this.

Note that `MapVector::erase()` is a linear time operation (it was and
still is).  I'll commit a new method in a moment called
`MapVector::remove_if()` that deletes multiple entries in linear time,
which should be slightly less painful.

llvm-svn: 213084
2014-07-15 18:32:30 +00:00
Argyrios Kyrtzidis
5daccdf69f Move the API and implementation of clang::driver::getARMCPUForMArch() to llvm::Triple::getARMCPUForArch().
Suggested by Eric Christopher.

llvm-svn: 212846
2014-07-11 21:44:54 +00:00
David Majnemer
410442b39d ADT: Add a drop_back() helper to ArrayRef
The slice(N, M) interface is powerful but not concise when wanting to
drop a few elements off of an ArrayRef, fix this by adding a drop_back
method.

llvm-svn: 212370
2014-07-05 06:12:30 +00:00
David Blaikie
a2e836b256 Recommit 211309 (StringMap::insert), reverted in 211328 due to issues with private, but non-deleted, move members.
Certain versions of GCC (~4.7) couldn't handle the SFINAE on access
control, but with "= delete" (hidden behind a macro for portability)
this issue is worked around/addressed.

Patch by Agustín Bergé

llvm-svn: 211525
2014-06-23 18:28:53 +00:00
David Blaikie
f279d4f048 Fix some -Wsign-compare fallout from changing container count member functions to return unsigned instead of bool.
llvm-svn: 211393
2014-06-20 19:54:13 +00:00
Rafael Espindola
b39185a826 Revert "Add StringMap::insert(pair) consistent with the standard associative container concept."
This reverts commit r211309.

It looks like it broke some bots:

http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/15563/steps/compile/logs/stdio

llvm-svn: 211328
2014-06-20 00:23:03 +00:00
David Blaikie
f14625fbd8 Add StringMap::insert(pair) consistent with the standard associative container concept.
Patch by Agustín Bergé.

llvm-svn: 211309
2014-06-19 20:08:56 +00:00
Alp Toker
4d6e49afed Remove OwningPtr.h and associated tests
llvm::OwningPtr is superseded by std::unique_ptr.

llvm-svn: 211259
2014-06-19 07:25:18 +00:00
David Blaikie
01e532692b SmallVectorTest: Make the deleted member functions private to help MSVC users.
llvm-svn: 210665
2014-06-11 17:50:14 +00:00
Craig Topper
f86daf85d1 Convert StringMapEntry::Create to use StringRef instead of start/end pointers. Simpliies all in tree call sites. No functional change.
llvm-svn: 210638
2014-06-11 05:35:56 +00:00
NAKAMURA Takumi
33c9311492 SmallVectorTest.cpp: Use LLVM_DELETED_FUNCTION.
llvm-svn: 210507
2014-06-10 04:06:56 +00:00
David Blaikie
b9110d7667 SmallVector: support resize(N) with move-only types
Unfortunately there's no way to elegantly do this with pre-canned
algorithms. Using a generating iterator doesn't work because you default
construct for each element, then move construct into the actual slot
(bad for copy but non-movable types, and a little unneeded overhead even
in the move-only case), so just write it out manually.

This solution isn't exception safe (if one of the element's ctors calls
we don't fall back, destroy the constructed elements, and throw on -
which std::uninitialized_fill does do) but SmallVector (and LLVM) isn't
exception safe anyway.

llvm-svn: 210495
2014-06-09 22:26:20 +00:00
Craig Topper
b00824c629 [C++11] Use 'nullptr'.
llvm-svn: 210442
2014-06-08 22:29:17 +00:00
David Blaikie
a7b991031e SmallVector: Improve test coverage for insert with repetition
To test cases that involve actual repetition (> 1 elements), at least
one element before the insertion point, and some elements of the
original range that still fit in that range space after insertion.

Actually we need coverage for the inverse case too (where no elements
after the insertion point fit into the previously allocated space), but
this'll do for now, and I might end up rewriting bits of SmallVector to
avoid that special case anyway.

llvm-svn: 210436
2014-06-08 19:33:40 +00:00
David Blaikie
fd04eace77 SmallVector: More movable improvements - don't copy elements to make space when inserting repeated elements.
Also split and improve tests a bit.

llvm-svn: 210433
2014-06-08 19:12:31 +00:00
David Blaikie
ed9ff7ecbb SmallVector: Move, don't copy, elements to make space for an insertion.
llvm-svn: 210432
2014-06-08 19:12:28 +00:00
David Blaikie
e2870900ae SmallVectorTest: Remove some more robust checks added in r210429 since they caught some bugs I haven't fixed yet.
Specifically this caused inserting an element from a SmallVector into
itself when such an insertion would cause a reallocation. We have code
to handle this for non-reallocating cases, but it's not robust against
reallocation.

llvm-svn: 210430
2014-06-08 17:33:47 +00:00
David Blaikie
a97c319aa7 Fix some more moving-from-moved-from objects issues in SmallVector
(& because it makes it easier to test, this also improves
correctness/performance slightly by moving the last element in an insert
operation, rather than copying it)

llvm-svn: 210429
2014-06-08 16:55:13 +00:00
Stephen Canon
f8d21c729a APFloat: x - NaN needs to flip the signbit of NaN when x is a number.
Because we don't have a separate negate( ) function, 0 - NaN does double-duty as the IEEE-754 negate( ) operation, which (unlike most FP ops) *does* attach semantic meaning to the signbit of NaN.

llvm-svn: 210428
2014-06-08 16:53:31 +00:00
David Blaikie
7b67322aaf Ensure SmallVector::insert doesn't overwrite the last element in the range with the already-moved-from value
This would cause the last element in a range to be in a moved-from state
after an insert at a non-end position, losing that value entirely in the
process.

Side note: move_backward is subtle. It copies [A, B) to C-1 and down.
(the fact that it decrements both the second and third iterators before
the first movement is the subtle part... kind of surprising, anyway)

llvm-svn: 210426
2014-06-08 16:00:02 +00:00
David Blaikie
391e7a57eb Remove use of = default/= delete as they're unsupported on MSVC2012
llvm-svn: 208388
2014-05-09 02:26:36 +00:00
David Blaikie
336fe9979c Missed formatting
llvm-svn: 208362
2014-05-08 21:53:33 +00:00
David Blaikie
428752c172 StringMap: Move assignment and move construction.
llvm-svn: 208361
2014-05-08 21:52:29 +00:00
David Blaikie
02c16a31fb StringMap support for move-only values.
llvm-svn: 208359
2014-05-08 21:52:23 +00:00
Douglas Gregor
317f3d8838 Fix a use of uninitialized memory in SmallVector's move-assignment operator.
When we were moving from a larger vector to a smaller one but didn't
need to re-allocate, we would move-assign over uninitialized memory in
the target, then move-construct that same data again.

llvm-svn: 207663
2014-04-30 15:49:06 +00:00
Chandler Carruth
46cf170b93 [ADT] Teach PointerUnion to support assignment directly from nullptr to
clear it out.

llvm-svn: 207471
2014-04-29 00:14:27 +00:00
Chandler Carruth
b358251835 [cleanup] Add some actual positive tests for equality. This unittest
never actually compared for equality two pointer unions that were equal.
Fortunately, things seem to work. =]

llvm-svn: 207468
2014-04-28 23:44:14 +00:00
Chandler Carruth
942da7ea4b [cleanup] Make this test use a proper fixture rather than globals.
llvm-svn: 207466
2014-04-28 23:42:22 +00:00
Chandler Carruth
fbc3cedcab [cleanup] Fix the whitespace in this test. Notably, correct spacing
around pointer types.

llvm-svn: 207465
2014-04-28 23:37:53 +00:00
Duncan P. N. Exon Smith
ea68e6a3d5 SCC: Change clients to use const, NFC
It's fishy to be changing the `std::vector<>` owned by the iterator, and
no one actual does it, so I'm going to remove the ability in a
subsequent commit.  First, update the users.

<rdar://problem/14292693>

llvm-svn: 207252
2014-04-25 18:24:50 +00:00
Benjamin Kramer
f6c0615b06 Retire llvm::array_endof in favor of non-member std::end.
While there make array_lengthof constexpr if we have support for it.

llvm-svn: 206112
2014-04-12 16:15:53 +00:00
Saleem Abdulrasool
db61071b5a Support: generalise object type handling for Windows
This generalises the object file type parsing to all Windows environments.  This
is used by cygwin as well as MSVC environments for MCJIT.  This also makes the
triple more similar to Chandler's suggestion of a separate field for the object
file format.

llvm-svn: 205219
2014-03-31 16:34:41 +00:00
Tim Northover
15a133dcd6 ARM64: remove -m32/-m64 mapping with ARM.
This is causing the ARM build-bots to fail since they only include
the ARM backend and can't create an ARM64 target.

llvm-svn: 205132
2014-03-30 07:25:23 +00:00
Saleem Abdulrasool
e7827c151a Support: correct Windows normalisation
If the environment is unknown and no object file is provided, then assume an
"MSVC" environment, otherwise, set the environment to the object file format.

In the case that we have a known environment but a non-native file format for
Windows (COFF) which is used for MCJIT, then append the custom file format to
the triple as an additional component.

This fixes the MCJIT tests on Windows.

llvm-svn: 205130
2014-03-30 07:19:31 +00:00
Tim Northover
2f13163a84 ARM64: initial backend import
This adds a second implementation of the AArch64 architecture to LLVM,
accessible in parallel via the "arm64" triple. The plan over the
coming weeks & months is to merge the two into a single backend,
during which time thorough code review should naturally occur.

Everything will be easier with the target in-tree though, hence this
commit.

llvm-svn: 205090
2014-03-29 10:18:08 +00:00
Saleem Abdulrasool
d42d60171a Canonicalise Windows target triple spellings
Construct a uniform Windows target triple nomenclature which is congruent to the
Linux counterpart.  The old triples are normalised to the new canonical form.
This cleans up the long-standing issue of odd naming for various Windows
environments.

There are four different environments on Windows:

MSVC: The MS ABI, MSVCRT environment as defined by Microsoft
GNU: The MinGW32/MinGW32-W64 environment which uses MSVCRT and auxiliary libraries
Itanium: The MSVCRT environment + libc++ built with Itanium ABI
Cygnus: The Cygwin environment which uses custom libraries for everything

The following spellings are now written as:

i686-pc-win32 => i686-pc-windows-msvc
i686-pc-mingw32 => i686-pc-windows-gnu
i686-pc-cygwin => i686-pc-windows-cygnus

This should be sufficiently flexible to allow us to target other windows
environments in the future as necessary.

llvm-svn: 204977
2014-03-27 22:50:05 +00:00
NAKAMURA Takumi
e89c041912 ADT/PointerIntPairTest.cpp: Appease msc17.
- Use constructor instead of initializer list.
  - Disable ManyUnusedBits for now.

llvm-svn: 203436
2014-03-10 02:33:17 +00:00
Chandler Carruth
cdd1d88db5 [C++11] Now that we have C++11 and I've replaced the use of this
horrible smart pointer by std::unique_ptr and strict move semantics, rip
this out.

llvm-svn: 203392
2014-03-09 11:51:11 +00:00
Ahmed Charles
702ca0ade7 [C++11] Add llvm::make_unique, according to N3656.
llvm-svn: 203387
2014-03-09 11:20:17 +00:00
David Blaikie
c1d84adec0 Revert "Clean up SmallString a bit"
This reverts commit r203374.

Ambiguities in assign... oh well. I'm just going to revert this and
probably not try to recommit it as it's not terribly important.

llvm-svn: 203375
2014-03-09 06:22:58 +00:00
David Blaikie
dd689683ff Clean up SmallString a bit
Move a common utility (assign(iter, iter)) into SmallVector (some of the
others could be moved there too, but this one seemed particularly
generic) and replace repetitions overrides with using directives.

And simplify SmallVector::assign(num, element) while I'm here rather
than thrashing these files (that cause everyone to rebuild) again.

llvm-svn: 203374
2014-03-09 06:17:01 +00:00
Ahmed Charles
aef83f2d60 Fix 80 cols.
llvm-svn: 203346
2014-03-08 12:51:31 +00:00
Eli Bendersky
e82561fbeb Fix EXPECT_* to not produce a compile warning.
EXPECT_TRUE/FALSE is also more idiomatic for booleans than EXPECT_EQ

llvm-svn: 203284
2014-03-07 21:04:24 +00:00
Jordan Rose
50156aa1c0 [ADT] Update PointerIntPair to handle pointer types with more than 31 bits free.
Previously, the assertions in PointerIntPair would try to calculate the value
(1 << NumLowBitsAvailable); the inferred type here is 'int', so if there were
more than 31 bits available we'd get a shift overflow.

Also, add a rudimentary unit test file for PointerIntPair.

llvm-svn: 203273
2014-03-07 19:19:56 +00:00
Benjamin Kramer
c92e236041 [C++11] Replace LLVM-style type traits with C++11 standard ones.
No functionality change.

llvm-svn: 203242
2014-03-07 14:42:25 +00:00
Saleem Abdulrasool
95baea0ae3 Support: split object format out of environment
This is a preliminary setup change to support a renaming of Windows target
triples.  Split the object file format information out of the environment into a
separate entity.  Unfortunately, file format was previously treated as an
environment with an unknown OS.  This is most obvious in the ARM subtarget where
the handling for macho on an arbitrary platform switches to AAPCS rather than
APCS (as per Apple's needs).

llvm-svn: 203160
2014-03-06 20:47:11 +00:00
Ahmed Charles
4393ae106a [C++11] Add release() to OwningPtr.
This will make the transition to unique_ptr easier by allowing more
incremental changes.

llvm-svn: 202949
2014-03-05 08:25:08 +00:00
Yaron Keren
767b50ea7b Cleaning up a bunch of pre-Visual C++ 2012 build hacks.
llvm-svn: 202806
2014-03-04 09:23:33 +00:00
Benjamin Kramer
e3d4c30feb Give APInt move semantics.
The interaction between defaulted operators and move elision isn't
totally obvious, add a unit test so it doesn't break unintentionally.

llvm-svn: 202662
2014-03-02 20:56:28 +00:00
Benjamin Kramer
e4eb1b495f [C++11] Replace llvm::next and llvm::prior with std::next and std::prev.
Remove the old functions.

llvm-svn: 202636
2014-03-02 12:27:27 +00:00
Chandler Carruth
db906c8499 [C++11] Switch all uses of the llvm_move macro to use std::move
directly, and remove the macro.

llvm-svn: 202612
2014-03-02 04:08:41 +00:00
Chandler Carruth
137ae633c7 [C++11] Add support for OwningPtr<T> to be converted to and from
std::unique_ptr<T>.

Patch by Ahmed Charles!

llvm-svn: 202609
2014-03-02 03:38:32 +00:00