| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
This reverts commit r335839, because it breaks the MSVC build.
llvm-svn: 335844
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This allows the implicit ArrayRef conversions to kick in when e.g.
comparing ArrayRef to a SmallVector.
Reviewers: zturner, dblaikie
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D48632
llvm-svn: 335839
|
|
|
|
|
|
| |
We want to check that we can assign to an lvalue here, not a prvalue.
llvm-svn: 324152
|
|
|
|
|
|
|
|
| |
clang OOMs on arm.
This reverts commit a272b2f2ef63f7f602c9ef4d9e10dc4eb9f00aa1.
llvm-svn: 322818
|
|
|
|
|
|
|
|
|
|
| |
Summary: Not sure this needs a review or not. Erring on the safe side.
Reviewers: dblaikie
Differential Revision: https://reviews.llvm.org/D41666
llvm-svn: 322538
|
|
|
|
|
|
|
|
|
|
|
|
| |
The intent of the test is to check that array lengths greater than
UINT_MAX work properly. Change the test to stress that scenario, without
triggering pointer overflow UB.
Caught by a WIP pointer overflow checker in clang.
Differential Revision: https://reviews.llvm.org/D33149
llvm-svn: 304353
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D26999
llvm-svn: 287722
|
|
|
|
|
|
|
|
|
|
| |
This re-applies r283798, disabled in r283803, with the static_assert
tests disabled under MSVC. The deleted functions still seem to catch
mistakes in MSVC, so it's not a significant loss.
Part of rdar://problem/16375365
llvm-svn: 283935
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit r283798, as it causes static asserts on
MSVC 2015 with the following errors:
ArrayRefTest.cpp(38): error C2338: Assigning from single prvalue element
ArrayRefTest.cpp(41): error C2338: Assigning from single xvalue element
ArrayRefTest.cpp(47): error C2338: Assigning from an initializer list
llvm-svn: 283803
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without this, the following statements will create ArrayRefs that
refer to temporary storage that goes out of scope by the end of the
line:
someArrayRef = getSingleElement();
someArrayRef = {elem1, elem2};
Note that the constructor still has this problem:
ArrayRef<Element> someArrayRef = getSingleElement();
ArrayRef<Element> someArrayRef = {elem1, elem2};
but that's a little harder to get rid of because we want to be able to
use this in calls:
takesArrayRef(getSingleElement());
takesArrayRef({elem1, elem2});
Part of rdar://problem/16375365. Reviewed by Duncan Exon Smith.
llvm-svn: 283798
|
|
|
|
| |
llvm-svn: 280129
|
|
|
|
|
|
|
| |
Reviewed By: majnemer, rnk
Differential Revision: https://reviews.llvm.org/D23965
llvm-svn: 280114
|
|
|
|
|
|
|
|
|
|
| |
The InitializerList test had undefined behavior by creating a dangling pointer to the temporary initializer list. This patch removes the undefined behavior in the test by creating the initializer list directly.
Reviewers: mehdi_amini, dblaikie
Differential Revision: https://reviews.llvm.org/D23890
llvm-svn: 279783
|
|
|
|
|
|
|
|
|
|
| |
Also fix slice wrappers drop_front and drop_back.
The unittests are pretty awkward, but do the job; alternatives
welcome!
..and yes, I do have ArrayRefs with more than 4 billion elements.
llvm-svn: 271546
|
|
|
|
|
|
|
|
| |
We have it for StringRef but not ArrayRef, and ArrayRef has drop_back,
so I see no reason it shouldn't have drop_front. Splitting this out of a
change that I have that will use this funcitonality.
llvm-svn: 268434
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The purpose is to allow templated wrapper to work with either
ArrayRef or any convertible operation:
template<typename Container>
void wrapper(const Container &Arr) {
impl(makeArrayRef(Arr));
}
with Container being a std::vector, a SmallVector, or an ArrayRef.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 247214
|
|
|
|
| |
llvm-svn: 244023
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
unbreak bots.
For example of mingw-w64-g++-4.8.1,
llvm/unittests/ADT/ArrayRefTest.cpp: In member function 'virtual void {anonymous}::ArrayRefTest_AllocatorCopy_Test::TestBody()':
llvm/unittests/ADT/ArrayRefTest.cpp:56:40: internal compiler error: in count_type_elements, at expr.c:5523
} Array3Src[] = {{"hello"}, {"world"}};
^
Please submit a full bug report,
with preprocessed source if appropriate.
llvm-svn: 244017
|
|
|
|
|
|
|
| |
std::copy does not work for non-trivially copyable classes when we're
copying into uninitialized memory.
llvm-svn: 243995
|
|
|
|
| |
llvm-svn: 239399
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With initializer lists there is a really neat idiomatic way to write
this, 'ArrayRef.equals({1, 2, 3, 4, 5})'. Remove the equal method which
always had a hard limit on the number of arguments. I considered
rewriting it with variadic templates but that's not really a good fit
for a function with homogeneous arguments.
'ArrayRef == {1, 2, 3, 4, 5}' would've been even more awesome, but C++11
doesn't allow init lists with binary operators.
llvm-svn: 230907
|
|
|
|
|
|
| |
initializer lists. Should also silence a -Wsign-compare warning accidentally introduced.
llvm-svn: 229515
|
|
|
|
|
|
| |
values and as function arguments also work as expected.
llvm-svn: 229513
|
|
|
|
|
|
| |
initialization.
llvm-svn: 229512
|
|
|
|
|
|
|
|
| |
MSVC 2013 and GCC. Added a trivial test to ensure the ArrayRef initializer list constructor is called and behaves as expected.
If any of the bots complain (perhaps due to an antiquated version of an STL implementation), I will revert.
llvm-svn: 229502
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
where T is a base of U.
llvm-svn: 225053
|
|
|
|
|
|
| |
ArrayRef-of-pointer conversions introduced in r216709
llvm-svn: 216830
|
|
|
|
| |
llvm-svn: 216821
|
|
|
|
| |
llvm-svn: 216008
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
Now to copy a string into a BumpPtrAllocator and get a StringRef to the copy:
StringRef myCopy = myStr.copy(myAllocator);
llvm-svn: 200885
|