summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2015-11-13 10:51:35 +0000
committerTamas Berghammer <tberghammer@google.com>2015-11-13 10:51:35 +0000
commit2e31ce1ea7ce3a16202bb55130d552b753282a33 (patch)
tree157de0c6ca63cbfcef585d62aed573570467519e
parentbe994649b44300e53c5c6801dbc5803e67d8ac12 (diff)
downloadbcm5719-llvm-2e31ce1ea7ce3a16202bb55130d552b753282a33.tar.gz
bcm5719-llvm-2e31ce1ea7ce3a16202bb55130d552b753282a33.zip
Remove a broken hack from Scalar::ULongLong and fix a test
Change Test-rdar-12481949.py to expect GetValueAsUnsigned() to return 0xffffffff if the variable is an int32_t (signed, 4 byte integer) with value of -1. The previous expectation where we expected the value to be 0xffffffffffffffff doesn't make sense as nothing explains why we would treat it as an 8 byte value. This CL also removes a hack from Scalar::ULongLong what was most likely added to get this test passing as it only worked in case the value of the variable is -1 and didn't make any sense even in that case. Differential revision: http://reviews.llvm.org/D14611 llvm-svn: 253027
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py4
-rw-r--r--lldb/source/Core/Scalar.cpp2
2 files changed, 2 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py b/lldb/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py
index 3b0d3fe6a30..f56fd96e466 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py
@@ -50,5 +50,5 @@ class Radar12481949DataFormatterTestCase(TestBase):
self.assertTrue(self.frame().FindVariable("myvar").GetValueAsSigned() != 0xFFFFFFFFFFFFFFFF, "GetValueAsSigned() does not say 0xFFFFFFFFFFFFFFFF")
self.assertTrue(self.frame().FindVariable("myvar").GetValueAsUnsigned() != -1, "GetValueAsUnsigned() does not say -1")
- self.assertTrue(self.frame().FindVariable("myvar").GetValueAsUnsigned() == 0xFFFFFFFFFFFFFFFF, "GetValueAsUnsigned() says 0xFFFFFFFFFFFFFFFF")
- self.assertTrue(self.frame().FindVariable("myvar").GetValueAsSigned() != 0xFFFFFFFF, "GetValueAsUnsigned() does not say 0xFFFFFFFF")
+ self.assertTrue(self.frame().FindVariable("myvar").GetValueAsUnsigned() == 0xFFFFFFFF, "GetValueAsUnsigned() says 0xFFFFFFFF")
+ self.assertTrue(self.frame().FindVariable("myvar").GetValueAsUnsigned() != 0xFFFFFFFFFFFFFFFF, "GetValueAsUnsigned() does not says 0xFFFFFFFFFFFFFFFF")
diff --git a/lldb/source/Core/Scalar.cpp b/lldb/source/Core/Scalar.cpp
index 400222813dc..92af3b7a657 100644
--- a/lldb/source/Core/Scalar.cpp
+++ b/lldb/source/Core/Scalar.cpp
@@ -1574,8 +1574,6 @@ Scalar::ULongLong(unsigned long long fail_value) const
case e_ulonglong:
case e_sint128:
case e_uint128:
- if(m_integer.isAllOnesValue())
- return *(const ulonglong_t *)(llvm::APInt::getAllOnesValue(128)).getRawData();
return *(const ulonglong_t *)m_integer.getRawData();
case e_float:
return (ulonglong_t)m_float.convertToFloat();
OpenPOWER on IntegriCloud