[PATCH] D142556: [DebugInfo] Merge partially matching chains of inlined locations

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 06:32:33 PST 2023


dstenb marked an inline comment as done.
dstenb added inline comments.


================
Comment at: llvm/lib/IR/DebugInfoMetadata.cpp:155-157
+    // The + 1 is to account for the &*rev_it = &(it - 1) relationship.
+    ARIt = LocVec::reverse_iterator(ALocs.begin() + IT->second + 1);
+    BRIt = LocVec::reverse_iterator(BLocs.begin() + I + 1);
----------------
dblaikie wrote:
> Would it be easier to express/read as arithmetic on rbegin, rather than begin->arithmetic->reverse?
The corresponding initializations based on `rbegin` would be:

```
ARIt = ALocs.rbegin() + (ALocs.size() - IT->second - 1);
BRIt = BLocs.rbegin() + (BLocs.size() - I - 1);
```

I think that they are about the same in terms of readability, so happy to pick either or.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142556/new/

https://reviews.llvm.org/D142556



More information about the llvm-commits mailing list