Details
- Reviewers
aprantl - Commits
- rG5941858efdca: [lldb][Module][NFC] Add ModuleList::AnyOf
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This is definitely useful — I just have one question: Isn't ForEach a special case of AnyOf? Could we implement on in terms of the other?
| lldb/include/lldb/Core/ModuleList.h | ||
|---|---|---|
| 480 | Why not std::function<bool(const lldb::Module &)> ? | |
| lldb/include/lldb/Core/ModuleList.h | ||
|---|---|---|
| 480 | Unfortunately a lot of APIs of Module are non-const since they rely on updating internal state :( | |
Yup it is. But it looked a bit too clever:
bool ret = false;
ForEach([&](auto const& module) {
if (callback(module)) {
ret = true;
return false;
}
return true;
}
return ret;Just iterating over m_modules seemed cleaner.
| lldb/include/lldb/Core/ModuleList.h | ||
|---|---|---|
| 480 | Re. why shared_ptr, that's because I just waned to align it with ForEach. I suppose if we're starting fresh we could just pass the reference. It would have to be mutable though | |
| lldb/source/Core/ModuleList.cpp | ||
|---|---|---|
| 1079 | module | |
Why not std::function<bool(const lldb::Module &)> ?