microsoft / DirectXShaderCompiler

This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.
Other
3.06k stars 677 forks source link

Add a new WeakVH value handle; NFC #6703

Closed adam-yang closed 3 months ago

adam-yang commented 3 months ago

Originally @lizhengxing's PR. Retargeting main.

This PR pulls 2 upstream changes, Add a new WeakVH value handle; NFC (https://github.com/llvm/llvm-project/commit/f1c0eafd5b10d33d957457ef292c56e6bab17938) and Use a 2 bit pointer in ValueHandleBase::PrevPair; NFC (https://github.com/llvm/llvm-project/commit/b297bff1cc974023a49d6ad898badf78a08692c3), into DXC.

Here's the summary of the changes:

Add a new WeakVH value handle; NFC

  WeakVH nulls itself out if the value it was tracking gets deleted, but it does not track RAUW.

  Reviewers: dblaikie, davide

  Subscribers: mcrosier, llvm-commits

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

Use a 2 bit pointer in ValueHandleBase::PrevPair; NFC

This was an omission in r301813. I had made the supporting changes to make this happen, but I forgot to actually update the

PrevPair declaration.

This is part 4 and 5 of the fix for #6659.