[PATCH] D45556: [DebugInfo] Generate DWARF debug information for labels.

Hsiangkai Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 16 07:40:18 PDT 2018


HsiangKai added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DebugHandlerBase.h:53
+using InlinedLabel =
+      std::pair<const DILabel *, const DILocation *>;
+using LabelInstrMap = MapVector<InlinedLabel, const MachineInstr *>;
----------------
aprantl wrote:
> Often it's better for readability to just define a struct with named members so we can access  .label and .loc instead of .first and .second.
If I group DILabel and DILocation in a struct, I need to add isEqual(), getHashValue(), getEmptyKey(), etc to conform the interface of MapVector. I think it is too complex for the purpose. std::pair is ready to use as the 'Key Type' of MapVector.

Use MapVector is easier to establish the mapping between InlinedLabel and MachineInstr.


Repository:
  rL LLVM

https://reviews.llvm.org/D45556





More information about the llvm-commits mailing list