aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.cpp
diff options
context:
space:
mode:
authorBalazs Benics <balazs.benics@sigmatechnology.se>2022-01-19 15:16:18 +0100
committerBalazs Benics <balazs.benics@sigmatechnology.se>2022-01-19 15:16:18 +0100
commit881b6a009fb6e2dd5fb924524cd6eacd14148a08 (patch)
tree73b83c5d39686438895ab420e90375b63d76716e /lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.cpp
parentdc18c5fa97e187475980f05acf12de5d9e3e941a (diff)
downloadllvm-881b6a009fb6e2dd5fb924524cd6eacd14148a08.zip
llvm-881b6a009fb6e2dd5fb924524cd6eacd14148a08.tar.gz
llvm-881b6a009fb6e2dd5fb924524cd6eacd14148a08.tar.bz2
[analyzer][NFC] Re-enable skipped SValTests by relaxing expectations
Some tests were skipped in D114454 to resolve test failures on some platforms, where the pointers have different bitwidth than expected. This patch re-enables these tests, by relaxing the requirements on the types of the SVal. The issue: There is no way to reconstruct the type of the `SVal` perfectly accurately, since there could be multiple types having the required bitwidth and signedness. Consider platforms where `int` and `long` have the same bitwidth. Additionally, we need to be careful about casting a pointer to an integral representation, because we don't know what smallest integral type can represent that. To workaround these issues, I propose enforcing a type that has the same signedness and bitwidth as the expected type, instead of perfect equality. In the `GetLocAsIntType` test, in case of pointer-to-integral casts I'm using the widest standard integral type (long long) to make sure that the pointer can be represented by the type without losing precision. This won't affect the test in any meaningful way, since the type of the `lvalue` remained the same. In one case, I had to replace `getUIntPtrType()` with `UnsignedLongTy` because on some platforms `getUIntPtrType()` is different then `long int`. In this patch, I also enforce that the tests must compile without errors, to prevent narrowing conversions in the future. Reviewed By: stevewan Differential Revision: https://reviews.llvm.org/D115349
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.cpp')
0 files changed, 0 insertions, 0 deletions