[PATCH] D135166: [DebugInfo] getMergedLocation: Maintain the line number if they match
Orlando Cazalet-Hyams via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 25 05:35:35 PDT 2022
Orlando accepted this revision.
Orlando added a comment.
There are a few outstanding review comments to be addressed:
1. I think it would be a good idea to update the function's comment in llvm/IR/DebugInfoMetadata.h.
2. The comments should end with a full stops (more info <https://llvm.org/docs/CodingStandards.html#commenting>).
3. Your comment `Style: Remove the brackets`.
Feel free to address those before pushing (i.e. IMO no need for another round of review).
LGTM with those changes.
================
Comment at: llvm/lib/IR/DebugInfoMetadata.cpp:127
+ // Walk from the current source locaiton until the file scope;
+ // then, do the same for the inlined-at locations
+ auto AdvanceToParentLoc = [&S, &L, &Line, &Col]() {
----------------
nit: full stop.
================
Comment at: llvm/lib/IR/DebugInfoMetadata.cpp:144
+
+ // Walk the source locations of LocB until a match with LocA is found
S = LocB->getScope();
----------------
nit: full stop.
================
Comment at: llvm/lib/IR/DebugInfoMetadata.cpp:155
+ // If the lines don't match, pick a "line 0" location but keep
+ // the current scope and inlined-at
+ bool SameLine = Line == MatchLoc->second.first;
----------------
nit: full stop.
================
Comment at: llvm/lib/IR/DebugInfoMetadata.cpp:168
+ // If the two locations are irreconsilable, pick any scope.
+ // and return a "line 0" location
+ Line = Col = 0;
----------------
nit: full stop.
================
Comment at: llvm/unittests/IR/MetadataTest.cpp:1031
+
+ // Two locations, same line/column different file, inlined at the same place
+ {
----------------
nit: full stop.
================
Comment at: llvm/unittests/IR/MetadataTest.cpp:1061
+ // Two locations, same line/column different file, one location with 2 scopes,
+ // inlined at the same place
+ {
----------------
nit: full stop.
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