Meinersbur added inline comments.
================
Comment at: lib/Sema/SemaOverload.cpp:6194
static SmallVector<EnableIfAttr *, 4>
getOrderedEnableIfAttrs(const FunctionDecl *Function) {
SmallVector<EnableIfAttr *, 4> Result;
----------------
nicholas wrote:
> This function shouldn't be necessary any more. All it's doing now is making
> an unnecessary copy.
I tried to keep the diff small and obvious. I'll refactor it in the next diff
update.
================
Comment at: lib/Sema/SemaOverload.cpp:8943
- // FIXME: The next several lines are just
- // specific_attr_iterator<EnableIfAttr> but going in declaration order,
- // instead of reverse order which is how they're stored in the AST.
auto Cand1Attrs = getOrderedEnableIfAttrs(Cand1);
auto Cand2Attrs = getOrderedEnableIfAttrs(Cand2);
----------------
nicholas wrote:
> This would become "auto Cand1Attrs = Cand1->specific_attrs<EnableIfAttr>();"
> but I think you can simplify that even further if you want. To do that you'd
> need to sink the "return Comparison::Worse;" inside the loop that follows it.
> If you don't do that you'll have to switch the calls to Cand1Attrs.size() and
> Cand2Attrs.size() into calls to std::distance, since llvm::iterator_range
> doesn't have a size() method.
Thanks for the hint.
Repository:
rC Clang
https://reviews.llvm.org/D48100
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits