about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm_util.rs
diff options
context:
space:
mode:
authorChayim Refael Friedman <chayimfr@gmail.com>2024-09-23 01:54:40 +0300
committerChayim Refael Friedman <chayimfr@gmail.com>2024-09-23 01:54:40 +0300
commitb14cd717dc388fea1f57989e02c7ac1fa4317659 (patch)
tree117c0c89eb9fe17decb63b216f1a1ff1ff025dbf /compiler/rustc_codegen_llvm/src/llvm_util.rs
parent814da15d8baf2391f4d19cbc4bf73f81ffbeabdf (diff)
downloadrust-b14cd717dc388fea1f57989e02c7ac1fa4317659.tar.gz
rust-b14cd717dc388fea1f57989e02c7ac1fa4317659.zip
Fix a bug in span map merge, and add explanations of how span maps are stored
Because it took me hours to figure out that contrary to common sense, the offset stored is the *end* of the node, and we search by the *start*. Which is why we need a convoluted `partition_point()` instead of a simple `binary_search()`. And this was not documented at all. Which made me make mistakes with my implementation of `SpanMap::merge()`.

The other bug fixed about span map merging is correctly keeping track of the current offset in presence of multiple sibling macro invocations. Unrelated, but because of the previous issue it took me hours to debug, so I figured out I'll put them together for posterity.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
0 files changed, 0 insertions, 0 deletions