NoQ added a comment.

In D64991#1662185 <https://reviews.llvm.org/D64991#1662185>, @Szelethus wrote:

> Hmm, we could make a redundant assignments checker: if a variable has 
> multiple reaching definitions, but those all assign the same value, emit a 
> warning. We could even use fixits with that.
>
>   void t(int a) {
>     if (coin())
>       a = 2; // note: reaching def
>     else
>       a = 2; // note: reaching def
>     use(a); // warn: a is always 2 here
>   }


Sounds like a useful //compiler warning// to me.

Also what specific fixit do you have in mind and why do you think it'll be 
easily obtainable from the results of the reaching definition analysis?


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

https://reviews.llvm.org/D64991



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to