[compiler-rt] c42e555 - [NFC][sanitizer] Delegate ArrayRef constructors

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 16:15:28 PDT 2023


In this case you ask if I can add any coverage for this class :)
Indirectly it used by
compiler-rt/lib/sanitizer_common/tests/sanitizer_common_range_test.cpp
I will add dedicated tests for the class.

On Mon, 5 Jun 2023 at 12:51, David Blaikie <dblaikie at gmail.com> wrote:

> Could add some test coverage for that minor fix for the ArrayRef(constT*,
> constT*) ctor.
>
> On Fri, Jun 2, 2023 at 2:32 PM Vitaly Buka via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>>
>> Author: Vitaly Buka
>> Date: 2023-06-02T14:32:03-07:00
>> New Revision: c42e555dc2b2df45027df62a28314446802cd8b7
>>
>> URL:
>> https://github.com/llvm/llvm-project/commit/c42e555dc2b2df45027df62a28314446802cd8b7
>> DIFF:
>> https://github.com/llvm/llvm-project/commit/c42e555dc2b2df45027df62a28314446802cd8b7.diff
>>
>> LOG: [NFC][sanitizer] Delegate ArrayRef constructors
>>
>> Added:
>>
>>
>> Modified:
>>     compiler-rt/lib/sanitizer_common/sanitizer_common.h
>>
>> Removed:
>>
>>
>>
>>
>> ################################################################################
>> diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.h
>> b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
>> index 358878e81c948..302b4437d64bd 100644
>> --- a/compiler-rt/lib/sanitizer_common/sanitizer_common.h
>> +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
>> @@ -1083,10 +1083,10 @@ template <typename T>
>>  class ArrayRef {
>>   public:
>>    ArrayRef() {}
>> -  ArrayRef(T *begin, T *end) : begin_(begin), end_(end) {}
>> +  ArrayRef(const T *begin, const T *end) : begin_(begin), end_(end) {}
>>
>>    template <typename C>
>> -  ArrayRef(const C &src) : begin_(src.data()), end_(src.data() +
>> src.size()) {}
>> +  ArrayRef(const C &src) : ArrayRef(src.data(), src.data() + src.size())
>> {}
>>
>>    const T *begin() const { return begin_; }
>>    const T *end() const { return end_; }
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230605/58c1d337/attachment.html>


More information about the llvm-commits mailing list