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:
Tamas Berghammer
2015-07-13 10:50:55 +00:00
parent 77dc9569c6
commit 5f0bc1a859

View File

@@ -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))