[PATCH] D49741: [DebugInfo/DWARF] [1/4] De-segregate type units and compile units. NFC

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 30 10:40:24 PDT 2018


probinson added inline comments.


================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h:29
 
   // VTable anchor.
   ~DWARFCompileUnit() override;
----------------
aprantl wrote:
> `///`
OK, but most methods in this hierarchy don't.


================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h:32
+  void dump(raw_ostream &OS, DIDumpOptions DumpOpts) override;
+  // Enable LLVM-style RTTI.
+  static bool classof(const DWARFUnit *U) { return !U->isTypeUnit(); }
----------------
aprantl wrote:
> `///`
OK, but most methods in this hierarchy don't.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp:63
+  DWARFDataExtractor Data(Obj, Section, LE, 0);
+  if (!Parser) {
+    const DWARFUnitIndex *Index = nullptr;
----------------
aprantl wrote:
> I understand you only moved this function, but if you happen to know it would be nice to add a comment here explaining  why the parser may be null? Is this a lazy initialization?
It is lazy initialization.  This allows DWARFUnitSection to be constructed before knowing what all the section-related data will be; the Parse function needs to have all the sections available to it.


Repository:
  rL LLVM

https://reviews.llvm.org/D49741





More information about the llvm-commits mailing list