[PATCH] D29061: [PM] Introduce a PoisoningVH as a (more expensive) alternative to AssertingVH that delays any reported error until the handle is *used*.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 23 17:01:17 PST 2017


chandlerc created this revision.
Herald added a subscriber: mcrosier.

This allows data structures to contain handles which become dangling
provided the data structure is cleaned up afterward rather than used for
anything interesting.

The implementation is moderately horrible in part because it works to
leave AssertingVH in place, undisturbed. If at some point there is
consensus that this is simply how AssertingVH should be used, it can be
substantially simplified.

This remains a boring pointer in a non-asserts build as you would
expect. The only place we pay cost is in asserts builds.

I plan to use this as a basis for replacing the asserting VHs that
currently dangle in the new PM until invalidation occurs in both LVI and
SCEV.


https://reviews.llvm.org/D29061

Files:
  include/llvm/IR/ValueHandle.h
  unittests/IR/ValueHandleTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29061.85492.patch
Type: text/x-patch
Size: 8952 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170124/96f4c596/attachment.bin>


More information about the llvm-commits mailing list