aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
diff options
context:
space:
mode:
authorStefan Granitz <stefan.graenitz@gmail.com>2018-08-14 11:07:18 +0000
committerStefan Granitz <stefan.graenitz@gmail.com>2018-08-14 11:07:18 +0000
commit2397a2b6e20224d31f27743722a8536a4d09c797 (patch)
treea08b75f74fc205c87c0e2e28dca3052e4f5fba6f /llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
parentc66d480bce3c18d9a665875e4d87b4ad507a6a82 (diff)
downloadllvm-2397a2b6e20224d31f27743722a8536a4d09c797.zip
llvm-2397a2b6e20224d31f27743722a8536a4d09c797.tar.gz
llvm-2397a2b6e20224d31f27743722a8536a4d09c797.tar.bz2
Fix: ConstString::GetConstCStringAndSetMangledCounterPart() should update the value if the key exists already
Summary: This issue came up because it caused problems in our unit tests. The StringPool did connect counterparts only once and silently ignored the values passed in subsequent calls. The simplest solution for the unit tests would be silent overwrite. In practice, however, it seems useful to assert that we never overwrite a different mangled counterpart. If we ever have mangled counterparts for other languages than C++, this makes it more likely to notice collisions. I added an assertion that allows the following cases: * inserting a new value * overwriting the empty string * overwriting with an identical value I fixed the unit tests, which used "random" strings and thus produced collisions. It would be even better if there was a way to reset or isolate the StringPool, but that's a different story. Reviewers: jingham, friss, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D50536 llvm-svn: 339669
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp')
0 files changed, 0 insertions, 0 deletions