diff options
author | Matthias Braun <matze@braunis.de> | 2017-05-19 22:37:09 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2017-05-19 22:37:09 +0000 |
commit | 50ec0b5dceff1f3fe9379580bc64480957a6ff83 (patch) | |
tree | 92e8dfee8c92b4b3c68b2688d6d3969bc66a6028 /lldb/packages/Python/lldbsuite/test/configuration.py | |
parent | 89f3bcf0b526ebc0ebee949554c3f9b5bd199182 (diff) | |
download | bcm5719-llvm-50ec0b5dceff1f3fe9379580bc64480957a6ff83.tar.gz bcm5719-llvm-50ec0b5dceff1f3fe9379580bc64480957a6ff83.zip |
SimplifyLibCalls: Optimize wcslen
Refactor the strlen optimization code to work for both strlen and wcslen.
This especially helps with programs in the wild where people pass
L"string"s to const std::wstring& function parameters and the wstring
constructor gets inlined.
This also fixes a lingerind API problem/bug in getConstantStringInfo()
where zeroinitializers would always give you an empty string (without a
length) back regardless of the actual length of the initializer which
did not work well in the TrimAtNul==false causing the PR mentioned
below.
Note that the fixed getConstantStringInfo() needed fixes to SelectionDAG
memcpy lowering and may lead to some cases for out-of-bounds
zeroinitializer accesses not getting optimized anymore. So some code
with UB may produce out of bound memory reads now instead of just
producing zeros.
The refactoring "accidentally" fixes http://llvm.org/PR32124
Differential Revision: https://reviews.llvm.org/D32839
llvm-svn: 303461
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/configuration.py')
0 files changed, 0 insertions, 0 deletions