[all-commits] [llvm/llvm-project] 1b531d: [InstrRef][nfc] Remove usage of unique_ptrs of arr...

Felipe de Azevedo Piovezan via All-commits all-commits at lists.llvm.org
Thu Dec 14 08:22:46 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1b531d54f6234488dec048fec1c5aca331bf8f3d
      https://github.com/llvm/llvm-project/commit/1b531d54f6234488dec048fec1c5aca331bf8f3d
  Author: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
  Date:   2023-12-14 (Thu, 14 Dec 2023)

  Changed paths:
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
    M llvm/unittests/CodeGen/InstrRefLDVTest.cpp

  Log Message:
  -----------
  [InstrRef][nfc] Remove usage of unique_ptrs of arrays (#74203)

These are usually difficult to reason about, and they were being used to
pass raw pointers around with array semantic (i.e., we were using
operator [] on raw pointers). To put it in InstrRef terminology: we were
passing a pointer to a ValueTable but using it as if it were a
FuncValueTable.

These could have easily been SmallVectors, which now allow us to have
reference semantics in some places, as well as simpler initialization.

In the future, we can use even more pass-by-reference with some extra
changes in the code.




More information about the All-commits mailing list