[PATCH] D135166: [DebugInfo] getMergedLocation: Maintain the line number if they match

Juan Manuel Martinez CaamaƱo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 25 01:08:16 PDT 2022


jmmartinez marked 3 inline comments as done.
jmmartinez added inline comments.


================
Comment at: llvm/lib/IR/DebugInfoMetadata.cpp:119
+  unsigned Col = LocA->getColumn();
+  auto AdvanceToParentLoc = [&S, &L, &Line, &Col]() {
     S = S->getScope();
----------------
Orlando wrote:
> If I'm reading this right, `AdvanceToParentLoc` walks the entire scope chain from the source location up to file scope. Then walks the entire scope chain of the inlined-at location of the original source location up to file scope. Then, the entire scope chain of the inline-at location of that one, and so on. 
> 
> Is that right? I think it could be useful to add a comment explaining the traversal.
Exactly. I added a comment to explain the traversal. Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135166



More information about the llvm-commits mailing list