[llvm] r357026 - Revert "[llvm] Reapply "Prevent duplicate files in debug line header in dwarf 5.""

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 1 20:15:30 PDT 2019


Hi Ali,

Since we figured out how the test kept failing I've taken a look at a
couple of things and I think there are a couple of changes you can
make when you recommit as well.

> -  unsigned DwarfVersion;

I think instead of passing DwarfVersion down you can pass the Context
in for the tryGetFile call from where it's called and then just query
for the DwarfVersion there?

> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=357026&r1=357025&r2=357026&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Tue Mar 26 13:05:27 2019
> @@ -101,7 +101,6 @@ class DwarfCompileUnit final : public Dw
>    }
>
>  public:
> -  unsigned getDwarfVersion() const { return DD->getDwarfVersion(); }

Pretty sure this isn't needed or the changes to DwarfDebug.cpp


> -  const FileNameEntry &Entry = getFileNameEntry(FileIndex);
> +  const FileNameEntry &Entry = Prologue.FileNames[FileIndex - 1];

What's up with FileIndex vs FileIndex -1? I'm wary of those sorts of accesses.

Thanks!

-eric


More information about the llvm-commits mailing list