[PATCH] D52730: [analyzer] ConversionChecker: handle floating point
DonĂ¡t Nagy via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 7 04:27:13 PST 2018
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);
+ // getAllOneValues returns an APFloat with semantics corresponding to the
+ // bit size given as the first argument; this is the only function in
+ // APFloat.h that maps bit width to semantics.
+ llvm::APFloat Tmp = llvm::APFloat::getAllOnesValue(FloatingSize, true);
----------------
NoQ wrote:
> Hmm, so the remaining problem is how to extract float semantics from a float `QualType`? Would `ASTContext::getFloatTypeSemantics(DestType)` make sense?
Thank you, that is the method I was looking for!
Repository:
rC Clang
https://reviews.llvm.org/D52730
More information about the cfe-commits
mailing list