summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-06-13 21:10:22 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-06-14 22:03:03 +0200
commit5f565c04194bedb6535ce002fb53aa2134d9ff25 (patch)
treea76ea1afd57e6a5f025b28a53f1be2a20f11c3db /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parent6176f04436bb71825bb8ad51d13e4349daa3b506 (diff)
[IR] Support efficient AssertingVH/PoisoningVH lookup
Currently, there doesn't seem to be any way to look up a Value* in a map/set indexed by AssertingVH/PoisoningVH, without creating a value handle -- which is fairly expensive, because it involves adding the value handle to the use list and immediately removing it again. Using find_as(Value *) does not work (and is in fact worse than just using find(Value *)), because it will end up creating multiple value handles during the lookup itself. For AssertingVH, address this by simply using DenseMapInfo<T *> instead of manually implementing something. The AssertingVH<T> will now get coerced to T*, rather than the other way around. For PoisoningVH, add extra overloads of getHashValue() and isEqual() that accept a T* argument. This allows using find_as(Value *) to perform efficient lookups in assertion-enabled builds. Differential Revision: https://reviews.llvm.org/D81793
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
0 files changed, 0 insertions, 0 deletions