DumpDataExtractor uses ClangASTContext in order to get the proper llvm
fltSemantics for the type it needs so that it can dump floats in a more
precise way. However, there's no reason that this behavior needs to be
specific ClangASTContext. Instead, I think it makes sense to ask
TypeSystems for the float semantics for a type of a given size.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Looks like a good improvement.
Does the APFloatBase::Bogus result of GetFloatTypeSemantics affect the functional behavior of the DumpDataExtractor or does GetAPInt just return None in that case?
Comment Actions
Hmm, good question. If you call GetAPInt with a byte_size of 0, it should assert when trying to read 0 bytes with the DataExtractor. In the worst case, it gives you a broken APInt. I think guarded the call to GetAPInt to protect against this, but I think that it would also be a good idea to make GetAPInt return llvm::None in that case.