[clang] [clang][dataflow] Refactor `PropagateResultObject()` with a switch statement. (PR #88865)

via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 16 23:34:09 PDT 2024


martinboehme wrote:

> > It's unfortunate that the enum syntax is so bulky (the need for `Stmt::` and the `Class` suffix).
> 
> Once we can use C++20, it could get a bit better thanks to https://en.cppreference.com/w/cpp/language/enum#Using-enum-declaration.

Good point, thanks.

> > I'm making this a non-draft PR and will add @Xazax-hun for an additional opinion.
> 
> I also don't have a strong opinion; I am fine with both styles. That being said, if C++ gets proper pattern matching in the future, the switch might be easier to refactor.

Thanks for your input!

So I think given that you and I are fine with both options and @ymand has a preference for the switch statement, I'll go with the switch statement.

In the meantime, I've landed two other PRs that touch `PropagateResultObject()` (#88872 and #88875). I'll integrate those changes in this PR and will ping the review thread once that has happened.

https://github.com/llvm/llvm-project/pull/88865


More information about the cfe-commits mailing list