This revision was automatically updated to reflect the committed changes.
Closed by commit rC347006: [analyzer] ConversionChecker: handle floating point
(authored by Szelethus, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D52730?vs=172922&id=174306#toc
Repository:
rC Cla
Szelethus added a comment.
Herald added a subscriber: gamesh411.
In https://reviews.llvm.org/D52730#1289989, @donat.nagy wrote:
> Could someone with commit rights commit this patch (if it is acceptable)? I
> don't have commit rights myself.
I'll do the honors. Thanks!
Repository:
rC Clang
Szelethus added inline comments.
Comment at: test/Analysis/conversion.c:195
+return r;
+ } else if (b>1<<25) {
+float f = b; // expected-warning {{Loss of precision}}
NoQ wrote:
> Szelethus wrote:
> > This too -- how about running clang-format on this fi
donat.nagy added a comment.
Could someone with commit rights commit this patch (if it is acceptable)? I
don't have commit rights myself.
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:158-162
+unsigned FloatingSize = AC.getTypeSize(DestType);
+// getAllO
donat.nagy updated this revision to Diff 172922.
donat.nagy marked an inline comment as done.
donat.nagy added a comment.
Use ASTContext::getFloatTypeSemantics()
Repository:
rC Clang
https://reviews.llvm.org/D52730
Files:
lib/StaticAnalyzer/Checkers/ConversionChecker.cpp
test/Analysis/co
NoQ accepted this revision.
NoQ added a comment.
The new addition makes perfect sense, please feel free to commit :) Eventually
i guess we'll need to declare where is this checker going and what specific
lint rule is this checker designed to check, document this rule, and move it to
`optin` onc
donat.nagy marked 7 inline comments as done.
donat.nagy added a comment.
I found a solution for determining the precision value of a floating point
type. Is this acceptable?
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:163
+
+switch (FloatingSize) {
+
xazax.hun accepted this revision.
xazax.hun added a comment.
This revision is now accepted and ready to land.
LGTM!
I only wonder if this should be on by default or guarded by a config option. I
do not have strong feelings about any of the options though.
Repository:
rC Clang
https://reviews
donat.nagy updated this revision to Diff 171678.
donat.nagy added a comment.
Use APFloat to determine precision of floating point type
Additionally, fix a typo in the tests.
Repository:
rC Clang
https://reviews.llvm.org/D52730
Files:
lib/StaticAnalyzer/Checkers/ConversionChecker.cpp
tes
NoQ added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:163
+
+switch (FloatingSize) {
+ case 64:
donat.nagy wrote:
> NoQ wrote:
> > Continuing the float semantics discussion on the new revision - Did you
> > consider `l
donat.nagy added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:163
+
+switch (FloatingSize) {
+ case 64:
NoQ wrote:
> Continuing the float semantics discussion on the new revision - Did you
> consider `llvm::APFloat`? (h
NoQ added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:163
+
+switch (FloatingSize) {
+ case 64:
Continuing the float semantics discussion on the new revision - Did you
consider `llvm::APFloat`? (http://llvm.org/doxygen
donat.nagy marked 2 inline comments as done.
donat.nagy added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:164
+// double and possibly long double on some systems
+RepresentsUntilExp = 53; break;
+ case 32:
d
donat.nagy updated this revision to Diff 170169.
donat.nagy added a comment.
Give a reference for the significand size values of the IEEE 754 floating point
types; cleanup comments and formatting.
Repository:
rC Clang
https://reviews.llvm.org/D52730
Files:
lib/StaticAnalyzer/Checkers/Conv
donat.nagy added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:164
+// double and possibly long double on some systems
+RepresentsUntilExp = 53; break;
+ case 32:
xazax.hun wrote:
> A link to the source of the
xazax.hun added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:164
+// double and possibly long double on some systems
+RepresentsUntilExp = 53; break;
+ case 32:
A link to the source of these number would be u
donat.nagy added a comment.
Herald added a subscriber: dkrupp.
polite ping
Repository:
rC Clang
https://reviews.llvm.org/D52730
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
donat.nagy marked 6 inline comments as done.
donat.nagy added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:175
+
+ if (RepresentsUntilExp >= sizeof(unsigned long long)*8) {
return false;
NoQ wrote:
> Szelethus wrote:
> > Sz
donat.nagy updated this revision to Diff 167929.
donat.nagy added a comment.
Fix formatting in tests; add a comment.
Repository:
rC Clang
https://reviews.llvm.org/D52730
Files:
lib/StaticAnalyzer/Checkers/ConversionChecker.cpp
test/Analysis/conversion.c
Index: test/Analysis/conversion.c
Szelethus added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:175
+
+ if (RepresentsUntilExp >= sizeof(unsigned long long)*8) {
return false;
NoQ wrote:
> Szelethus wrote:
> > Szelethus wrote:
> > > How about `AC.getSizeType
20 matches
Mail list logo