[PATCH] D60487: [llvm] Prevent duplicate files in debug line header in dwarf 5: another attempt

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 15 06:10:42 PDT 2019


MaskRay added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp:1013
+  else
+    return Prologue.FileNames[Index - 1];
+}
----------------
tamur wrote:
> MaskRay wrote:
> > For DWARF<5, if we make `FileNames[0]` a placeholder (i.e. waste the first entry), would that make the logic simpler? e.g. we may not need the two functions.
> Prologue.FileNames is public and is referred from outside. I don't want to change Prologue.FileNames implementation for Dwarf 4; that entails changing those clients and results in a larger patch. Alternatively, this patch is minimal and deals with 'dirty' stuff in a small, private method.
Thinking it more. Dispatching on `DwarfVersion >= 5` looks better to me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60487/new/

https://reviews.llvm.org/D60487





More information about the llvm-commits mailing list