[clang] [clang][dataflow] Fix result object location for builtin `<=>`. (PR #88726)

Yitzhak Mandelbaum via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 15 07:44:57 PDT 2024


================
@@ -508,6 +508,11 @@ class ResultObjectVisitor : public RecursiveASTVisitor<ResultObjectVisitor> {
         isa<CXXStdInitializerListExpr>(E)) {
       return;
     }
+    if (auto *Op = dyn_cast<BinaryOperator>(E);
----------------
ymand wrote:

I guess the `isa` calls were what we really jumped out since they amount to N calls and tests on `getStmtClass` rather than one and a jump. But, readability wins over performance here.

But, I do wonder about readability win from converting to a switch because it will directly express which cases are covered in this function, rather than leaving it implicit in a series of `if`s. FWIW.

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


More information about the cfe-commits mailing list