[all-commits] [llvm/llvm-project] 621ffb: [DX] Improve parse error messages

Chris B via All-commits all-commits at lists.llvm.org
Tue Jan 3 10:50:40 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 621ffbcbe4abe92fc085966f52fe95e2b8e19b8c
      https://github.com/llvm/llvm-project/commit/621ffbcbe4abe92fc085966f52fe95e2b8e19b8c
  Author: Chris Bieneman <chris.bieneman at me.com>
  Date:   2023-01-03 (Tue, 03 Jan 2023)

  Changed paths:
    M llvm/include/llvm/Object/DXContainer.h
    M llvm/lib/Object/DXContainer.cpp
    A llvm/test/tools/obj2yaml/DXContainer/PartTooSmall.yaml
    M llvm/unittests/Object/DXContainerTest.cpp

  Log Message:
  -----------
  [DX] Improve parse error messages

This change refactors the parte parsing logic to operate on StringRefs
of the part data rather than starting from an offset and splicing down.
It also improves some of the error reporting around part layout.

Specifically, this code now reports a distinct error if there isn't
enough data in the buffer to store the part size and it reports an
error if the parts overlap.

Reviewed By: bob80905

Differential Revision: https://reviews.llvm.org/D139681




More information about the All-commits mailing list