[llvm] [CodeGen][DebugValues] Fix unhandled error condition in VarLoc (PR #122019)
Stephen Tozer via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 9 03:19:11 PST 2025
SLTozer wrote:
This patch looks like it should be NFC? On its face it looks like a simplification - in the old code we check whether `V` contains `BB`, and if it does then we get `V.find(&BB)->second`. In the new code, we get `It = V.find(&BB)`, and if the result exists in `V` then we get `It->second`. The new code looks like a slight improvement for not searching the map twice, but I don't think it would return a different result - the getter function is written with the assumption that the caller already knows the item appears in the map (which it does), which is why we assert rather than potentially returning an empty value.
https://github.com/llvm/llvm-project/pull/122019
More information about the llvm-commits
mailing list