[PATCH] D45556: [DebugInfo] Generate DWARF debug information for labels.
Adrian Prantl via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 5 18:44:16 PDT 2018
aprantl accepted this revision.
aprantl added a comment.
This revision is now accepted and ready to land.
A couple of cosmetic changes in line, but otherwise this LGTM.
================
Comment at: lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.h:61
-void calculateDbgValueHistory(const MachineFunction *MF,
- const TargetRegisterInfo *TRI,
- DbgValueHistoryMap &Result);
+/// For each user label metadata, keep the corresponding DBG_LABEL
+/// instruction. The DBG_LABEL instruction could be used to generate
----------------
/// For each inlined instance of a source-level label, keep ...
================
Comment at: lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.h:63
+/// instruction. The DBG_LABEL instruction could be used to generate
+/// a temporary label before it.
+class DbgLabelInstrMap {
----------------
a temporary (assembler) label ...
================
Comment at: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:842
+ else
+ assert(0 && "DbgEntity must be DbgVariable or DbgLabel.");
+ }
----------------
we use `llvm_unreachable(` instead of `assert(0 &&`
================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1253
+
+ /// At this poinit, the temporary label is created.
+ /// Save the temporary label to DbgLabel entity to get the
----------------
point
================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1261
+ // Collect info for variables/labels that were optimized out.
for (const DINode *DN : SP->getRetainedNodes()) {
if (auto *DV = dyn_cast<DILocalVariable>(DN)) {
----------------
```
if (auto *DV = dyn_cast<DILocalVariable>(DN)) {
if (!Processed.insert(InlinedVariable(DV, nullptr)).second)
continue;
if (LexicalScope *Scope = LScopes.findLexicalScope(DN->getScope()))
createConcreteEntity(TheCU, *Scope, DN, nullptr);
```
?
================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.h:70
+ const DINode *Entity;
+ const DILocation *IA; /// Inlined at location.
+ DIE *TheDIE = nullptr;
----------------
Would be nice to rename to to `InlinedAt` in a follow-up commit.
================
Comment at: lib/CodeGen/AsmPrinter/DwarfFile.h:63
+ // Collection of dbg labels of a scope
+ using LabelList = SmallVector<DbgLabel *, 4>;
----------------
`///` ... `.`
Repository:
rL LLVM
https://reviews.llvm.org/D45556
More information about the llvm-commits
mailing list