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

via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 16 02:58:02 PDT 2024


martinboehme wrote:

Here's a draft that shows what `PropagateResultObject()` looks like when refactored using a switch statement.

I'm not sure if this is an improvement or not. I do see how this makes the case distinction clearer -- OTOH, we have one more level of indentation now (though that doesn't really hurt formatting), and there's duplication between the switch cases and the casts, for example:

```cxx
      case Stmt::BinaryOperatorClass: {
        auto *Op = cast<BinaryOperator>(E);
```

Would appreciate opinions.

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


More information about the cfe-commits mailing list