[PATCH] D149640: [clang][dataflow] Change PruneTriviallyFalseEdges for building CFG

Kinuko Yasuda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 2 08:31:13 PDT 2023


kinu added a comment.

(comment only)



================
Comment at: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp:2673
-
-        EXPECT_EQ(BarVal, FooPointeeVal);
       });
----------------
mboehme wrote:
> It's unfortuante that all of these checks have gone away. I think the test was actually trying to test something.
> 
> I'd suggest checking the environment at two different places:
> 
> ```
>     void target(int *Foo) {
>       do {
>         int Bar = *Foo;
>         // [[in_loop]]
>       } while (true);
>       (void)0;
>       // [[after_loop]]
>     }
> ```
> 
> You can keep the existing checks for the `in_loop` environment and verify that `Results` doesn't actually contain an environment for `after_loop`.
Wdyt if we change this to exercise `do { } while (false)` instead (with the checks that we already have), and add a simple while (true) {}?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149640/new/

https://reviews.llvm.org/D149640



More information about the cfe-commits mailing list