summaryrefslogtreecommitdiffstats
path: root/lldb/source/Symbol/ClangASTContext.cpp
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2016-04-14 17:22:18 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2016-04-14 17:22:18 +0000
commitda70c17bfce29c136bad88600afaa36aa0b91259 (patch)
treea81d84091d542cdb374ac44b036e74257e2248af /lldb/source/Symbol/ClangASTContext.cpp
parent5cfd306e00ddd88bbd5e50a305b7437e3ba92584 (diff)
downloadbcm5719-llvm-da70c17bfce29c136bad88600afaa36aa0b91259.tar.gz
bcm5719-llvm-da70c17bfce29c136bad88600afaa36aa0b91259.zip
Revert r266311 - Fix usage of APInt.getRawData for big-endian systems
Try to get 32-bit build bots running again. llvm-svn: 266341
Diffstat (limited to 'lldb/source/Symbol/ClangASTContext.cpp')
-rw-r--r--lldb/source/Symbol/ClangASTContext.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 603beb98215..7a62f82532b 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -72,7 +72,6 @@
#include "lldb/Core/Module.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/RegularExpression.h"
-#include "lldb/Core/Scalar.h"
#include "lldb/Core/StreamFile.h"
#include "lldb/Core/ThreadSafeDenseMap.h"
#include "lldb/Core/UniqueCStringMap.h"
@@ -8647,10 +8646,18 @@ ClangASTContext::ConvertStringToFloatValue (lldb::opaque_compiler_type_t type, c
const uint64_t byte_size = bit_size / 8;
if (dst_size >= byte_size)
{
- Scalar scalar = ap_float.bitcastToAPInt().zextOrTrunc(llvm::NextPowerOf2(byte_size) * 8);
- lldb_private::Error get_data_error;
- if (scalar.GetAsMemoryData(dst, byte_size, lldb_private::endian::InlHostByteOrder(), get_data_error))
+ if (bit_size == sizeof(float)*8)
+ {
+ float float32 = ap_float.convertToFloat();
+ ::memcpy (dst, &float32, byte_size);
return byte_size;
+ }
+ else if (bit_size >= 64)
+ {
+ llvm::APInt ap_int(ap_float.bitcastToAPInt());
+ ::memcpy (dst, ap_int.getRawData(), byte_size);
+ return byte_size;
+ }
}
}
}
OpenPOWER on IntegriCloud