================
----------------
steakhal wrote:
BTW why do we walk the base classes and all this?
Should this alternative implementation be simpler?
```c++
static bool hasNoDeleteAnnotation(const FunctionDecl *FD) {
if (llvm::any_of(FD->redecls(), isNoDeleteFunction))
return true;
const auto *MD = dyn_cast<CXXMethodDecl>(FD);
if (!MD && !MD->isVirtual())
return false;
auto Overriders = llvm::to_vector(MD->overridden_methods());
while (!Overriders.empty()) {
const auto *CurrFn = Overriders.pop_back_val();
llvm::append_range(Overriders, CurrFn->overridden_methods());
if (isNoDeleteFunction(CurrFn)) {
return true;
}
}
return false;
}
```
https://github.com/llvm/llvm-project/pull/178824
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits