xazax.hun added a comment. This demo looks cool. While I know this is a demo, I think it misses some important features, namely invalidating the value when we take the address of a variable or pass it to a function by non-const reference. I'm fine with not supporting those cases, but I'd love to see a comment about that. Just in case someone wants to use this analysis as a basis for something in production :)
================ Comment at: clang/unittests/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp:99 + +static constexpr char kVar[] = "var"; +static constexpr char kInit[] = "init"; ---------------- Do we need an actual array? I think this would copy `"var"` into a global array. Alternatively, using `static constexpr char* kVar= "var"`, we would just refer to the string in the read only memory. (Or maybe both would behave the same because compiler optimizations?) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115740/new/ https://reviews.llvm.org/D115740 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits