[PATCH] D113912: [JITLink] Fix splitBlock if there are symbols span across the boundary

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 15 10:51:44 PST 2021


lhames added a comment.

> I wonder if, rather than return Errors, it'd be better to trust the caller and split blocks anyway (as the code was), but truncate Symbol::size() as necessary to avoid it going past the end of the block it points at.

I like this as a short-term solution.

I think this issue exposes limitations in LinkGraph's current design. I'm not sure that we need/want LLVM-style users-lists for Symbols, but if we just added a ref-count to Symbols we could have a `.isUnreferenced` method that would be really helpful here: Clients could choose to remove unreferenced anonymous symbols (which should always be safe, since they can be recreated easily), and/or truncate named symbols, and then splitBlock could return an Error for any remaining symbols that extend past a split point.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113912



More information about the llvm-commits mailing list