[PATCH] D80381: Fix debug line info when line markers are present inside macros.
Leandro Vaz via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 22 02:25:43 PDT 2020
leandrov marked an inline comment as done.
leandrov added inline comments.
================
Comment at: llvm/lib/MC/MCParser/AsmParser.cpp:1705
+ return parseCppHashLineFilenameComment(IDLoc);
+ // Eat the line marker.
+ Lex();
----------------
thopre wrote:
> Is there code inside parseCppHashLineFilenameComment that could be hoisted out in a separate function that could be used here? If not, maybe you could create a function anyway which would make the code here smaller and more obvious.
>
> Might be nice having in the heading comment for that function the format of a line marker: # linenum filename flags. I don't know if it's customary to refer to documentation for a format when it's an online page, but if it is you could mention https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html in that heading comment.
`parseCppHashLineFilenameComment()` also calls `Lex()` 3 times but saves the content in the process. In here, we just want to skip it. I felt it wasn't worth to hoist out in a separate function (that in this case would simply discard token contents) and it's unlikely for this to repeat elsewhere... I would say to keep it like this (maybe) but let us wait for other reviewers.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80381/new/
https://reviews.llvm.org/D80381
More information about the llvm-commits
mailing list