[llvm] r340274 - [llvm-mca] Replace use of llvm::any_of with std::any_of.

Andrea Di Biagio via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 28 10:35:06 PDT 2018


I agree with you. I will add the missing include and reinstate the
llvm::any_of.

Thanks for your feedback!
Andrea


On Tue, Aug 28, 2018 at 6:27 PM, David Blaikie <dblaikie at gmail.com> wrote:

> Adding the missing inclnude sounds like it would probably be a better
> fix/match the intent of the code?
>
> On Tue, Aug 28, 2018 at 2:32 AM Andrea Di Biagio <
> andrea.dibiagio at gmail.com> wrote:
>
>> There is no problem with llvm::any_of.
>> That file didn't include STLExtras.h. So, the fix was to either include
>> that header file, or just use std::any_of in that statement.
>>
>>
>> On Tue, Aug 28, 2018 at 12:25 AM, David Blaikie via llvm-commits <
>> llvm-commits at lists.llvm.org> wrote:
>>
>>> What was the problem with llvm::any_of?
>>>
>>> On Tue, Aug 21, 2018 at 6:01 AM Andrea Di Biagio via llvm-commits <
>>> llvm-commits at lists.llvm.org> wrote:
>>>
>>>> Author: adibiagio
>>>> Date: Tue Aug 21 06:00:44 2018
>>>> New Revision: 340274
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=340274&view=rev
>>>> Log:
>>>> [llvm-mca] Replace use of llvm::any_of with std::any_of.
>>>>
>>>> This should unbreak the buildbots.
>>>>
>>>> Modified:
>>>>     llvm/trunk/tools/llvm-mca/Instruction.h
>>>>
>>>> Modified: llvm/trunk/tools/llvm-mca/Instruction.h
>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-
>>>> mca/Instruction.h?rev=340274&r1=340273&r2=340274&view=diff
>>>> ============================================================
>>>> ==================
>>>> --- llvm/trunk/tools/llvm-mca/Instruction.h (original)
>>>> +++ llvm/trunk/tools/llvm-mca/Instruction.h Tue Aug 21 06:00:44 2018
>>>> @@ -339,8 +339,9 @@ public:
>>>>    int getCyclesLeft() const { return CyclesLeft; }
>>>>
>>>>    bool hasDependentUsers() const {
>>>> -    return llvm::any_of(
>>>> -        Defs, [](const UniqueDef &Def) { return Def->getNumUsers() >
>>>> 0; });
>>>> +    return std::any_of(Defs.begin(), Defs.end(), [](const UniqueDef
>>>> &Def) {
>>>> +      return Def->getNumUsers() > 0;
>>>> +    });
>>>>    }
>>>>
>>>>    bool isDependencyBreaking() const { return IsDepBreaking; }
>>>>
>>>>
>>>> _______________________________________________
>>>> llvm-commits mailing list
>>>> llvm-commits at lists.llvm.org
>>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at lists.llvm.org
>>> http://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/20180828/4dd91c4e/attachment.html>


More information about the llvm-commits mailing list