[Lldb-commits] [PATCH] D18981: Fix usage of APInt.getRawData for big-endian systems

Ulrich Weigand via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 13 14:49:37 PDT 2016


uweigand updated this revision to Diff 53622.
uweigand added a comment.

This adds some unit tests verifying correct operation of the GetBytes routine as well as the conversions (SChar, UChar, ...).  Those tests actually exposed more problems in the original Scalar code: the SetValueFromData routine didn't work correctly for 128- and 256-bit data types, and the SChar routine should have an explicit "signed char" return type to work correctly on platforms where char defaults to unsigned.

Regression testing on Intel revealed a bug in my original patch: since Scalar only accepts APInt initializers with a bit size that is a power of 2, we may need to extend some values before converting them to Scalar.  This occured for values representing 10-byte Intel long double data.

Tested on System z and Intel.


http://reviews.llvm.org/D18981

Files:
  include/lldb/Core/Scalar.h
  include/lldb/Symbol/Type.h
  source/Core/Scalar.cpp
  source/Expression/IRInterpreter.cpp
  source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
  source/Symbol/ClangASTContext.cpp
  unittests/Core/ScalarTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18981.53622.patch
Type: text/x-patch
Size: 52620 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160413/226d8592/attachment-0001.bin>


More information about the lldb-commits mailing list