This patch changes return type of tryCandidate from void to bool. Because:
- Method in some targets already follows this convention. (SIMachineScheduler)
- This will help if some target wants to re-use generic code. (see PowerPC change part)
- This looks more intuitive - why tryLess/tryGreater returns bool while tryCandidate returns nothing?
Here all branches simply return true if they got compared. We may change this logic further: return true only if TopCand.Reason is set (not NoCand anymore), so that we can:
if (tryCandidate(Cand, TopCand, nullptr)) { Cand.setBest(TopCand); // ... }
Any comments are welcome. Thanks.
Update the comment to explain what the return value means. Why don't you return true when you set the reason to NodeOrder?