[PATCH] D147620: [DebugInfo] Keep the CU consistent for operating `DISubprogram`.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 16:45:45 PDT 2023


dblaikie added a comment.

The use of `getScope` seems to be the buggy part, maybe - it should be getting the scope from the appropriate CU and it isn't, maybe?

Also the LLVM UIR in the test case seems strange to me - I guess you've put DISubprogram dedfinitions scoped within the type declaration? That isn't usually how we do things & might lead to problems with debuggers since this may be unexpected. (GCC always puts the definitions at the global scope, clang puts the definitions at namespace scope I think - though perhaps at the global scope when there's a member function declaration anyway) Maybe that's part of the problem? (the scoping of the definitions - that it's not how LLVM ddebug info IR is usually generated by clang, so you may benefit from doing something more clang-like on the rust side to avoid running into more untested/unsupported cases)

Especially when it comes to type units and things, I can imagine this sort of IR might hit a lot of untested corners.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147620



More information about the llvm-commits mailing list