Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use llvm::any_of instead of std::ranges::any_of #4542

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

danakj
Copy link
Contributor

@danakj danakj commented Nov 15, 2024

We do not intend to use std::ranges in the Carbon implementation due to concerns of compile time cost, largely due to implicit instantiation of types involved in calling and typechecking the functions and their requires clauses.

In #4539, we converted std::any_of to std::ranges::any_of, but this replaces that with llvm::any_of from llvm/ADT/STLExtras.h.

This conversion was suggested by the modernize-use-ranges clang-tidy check. We can keep the check on, and use it to guide conversion to llvm helpers that do similar things (as was done in this CL now). If it's being too confusing, then it can be disabled as well.

We do not intend to use std::ranges in the Carbon implementation due to
concerns of compile time cost, largely due to implicit instantiation of
types involved in calling and typechecking the functions and their
requires clauses.

In carbon-language#4539, we converted std::any_of to std::ranges::any_of, but this
replaces that with llvm::any_of from llvm/ADT/STLExtras.h.

This conversion was suggested by the modernize-use-ranges clang-tidy
check. We can keep the check on, and use it to guide conversion to
llvm helpers that do similar things (as was done in this CL now). If
it's being too confusing, then it can be disabled as well.
@jonmeow jonmeow added this pull request to the merge queue Nov 15, 2024
Merged via the queue into carbon-language:trunk with commit a65cde6 Nov 15, 2024
10 checks passed
@danakj danakj deleted the anyof branch November 18, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants