mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 05:32:28 +08:00
Remove hack about the size of long doubles from DataExtractor
The size of a long double was hardcoded in DataExtractor for x86 and x86_64 architectures. This CL removes the hard coded values and use the actual size based on the floating point semantics specified. Differential revision: http://reviews.llvm.org/D8417 llvm-svn: 242019
This commit is contained in:
@@ -1830,10 +1830,8 @@ DataExtractor::Dump (Stream *s,
|
||||
}
|
||||
else if (item_bit_size == ast->getTypeSize(ast->LongDoubleTy))
|
||||
{
|
||||
auto byte_size = item_byte_size;
|
||||
const auto &semantics = ast->getFloatTypeSemantics(ast->LongDoubleTy);
|
||||
if (&semantics == &llvm::APFloat::x87DoubleExtended)
|
||||
byte_size = 10;
|
||||
const auto byte_size = (llvm::APFloat::getSizeInBits(semantics) + 7) / 8;
|
||||
|
||||
llvm::APInt apint;
|
||||
if (GetAPInt(*this, &offset, byte_size, apint))
|
||||
|
||||
Reference in New Issue
Block a user