zaks.anna added a comment.

I agree that we should not print the values of all variables. The users will be 
overwhelmed with the huge amount of information. It is very valuable to 
highlight just the right information. (I believe even the current diagnostics 
often produce too much info and highlighting the more important notes would be 
very valuable.) However, the examples you presented are **very compelling**. 
Are there ways we could highlight the same information without printing values 
of all variables?

For example, for the overflow case, we could experiment with printing notes 
along the path at the locations a variable overflows. This would be very 
valuable for the array overflow alpha checker, which often flags the bugs that 
only occur if an integer value along the path overflows. I am not sure how 
noisy this approach will be. If it is too noisy,  we could refine this further.

For the uninitialized variable example, we could have some pattern-matching 
logic that would check if the expression is an array element and if so print 
the value of the index. (Another problem with variables that are failed to be 
initialized in a function is that we do not display the path on which the 
variable is not initialized, making it hard to understand the reports. Though, 
that is a separate problem.)


https://reviews.llvm.org/D34508



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

Reply via email to