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

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 09:46:03 PDT 2023


I'd mistaken this for the code in llvm/AST which already has unit tests
that could be extended to cover this. Up to you if you want to add explicit
coverage for this class in compiler-rt

On Mon, Jun 5, 2023 at 4:16 PM Vitaly Buka <vitalybuka at google.com> wrote:

> 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/20230606/96f43ea9/attachment-0001.html>


More information about the llvm-commits mailing list