[all-commits] [llvm/llvm-project] e5d844: [Bitcode] Ensure DIArgList in bitcode has no null ...

Stephen Tozer via All-commits all-commits at lists.llvm.org
Thu Apr 22 04:05:29 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e5d844b5874488599dc79e788a2dd6efa02940fb
      https://github.com/llvm/llvm-project/commit/e5d844b5874488599dc79e788a2dd6efa02940fb
  Author: Stephen Tozer <Stephen.Tozer at Sony.com>
  Date:   2021-04-22 (Thu, 22 Apr 2021)

  Changed paths:
    M llvm/lib/Bitcode/Reader/MetadataLoader.cpp
    M llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
    M llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
    M llvm/lib/Bitcode/Writer/ValueEnumerator.h
    M llvm/test/DebugInfo/Generic/debug_value_list.ll

  Log Message:
  -----------
  [Bitcode] Ensure DIArgList in bitcode has no null or forward metadata refs

This patch fixes an issue in which ConstantAsMetadata arguments to a
DIArglist, as well as the Constant values referenced by that metadata,
would not be always be emitted correctly into bitcode. This patch fixes
this issue firstly by searching for ConstantAsMetadata in DIArgLists
(previously we would only search for them when directly wrapped in
MetadataAsValue), and secondly by enumerating all of a DIArgList's
arguments directly prior to enumerating the DIArgList itself.

This patch also adds a number of asserts, and no longer treats the
arguments to a DIArgList as optional fields when reading/writing to
bitcode.

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




More information about the All-commits mailing list