[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-10-02 Thread Umann Kristóf via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-10-02 Thread Donát Nagy via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-10-02 Thread Donát Nagy via Phabricator via 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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-10-30 Thread Donát Nagy via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-10-30 Thread Gábor Horváth via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-10-30 Thread Donát Nagy via Phabricator via cfe-commits
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) { +

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-11-01 Thread Artem Dergachev via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-11-07 Thread Donát Nagy via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-11-07 Thread Donát Nagy via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-11-07 Thread Umann Kristóf via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-11-15 Thread Umann Kristóf via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-11-15 Thread Umann Kristóf via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-10-18 Thread Donát Nagy via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-10-18 Thread Gábor Horváth via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-10-18 Thread Donát Nagy via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-10-19 Thread Donát Nagy via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-10-19 Thread Donát Nagy via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-10-19 Thread Artem Dergachev via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-10-24 Thread Donát Nagy via Phabricator via cfe-commits
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

[PATCH] D52730: [analyzer] ConversionChecker: handle floating point

2018-10-25 Thread Artem Dergachev via Phabricator via cfe-commits
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