1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
Commit Graph

12 Commits

Author SHA1 Message Date
Jeffrey Yasskin
20848835bf To catch bugs like the one fixed in
http://llvm.org/viewvc/llvm-project?view=rev&revision=78127, I'm changing the
ExecutionEngine's global mappings to hold AssertingVH<const GlobalValue>. That
way, if unregistering a mapping fails to actually unregister it, we'll get an
assert. Running the jit nightly tests didn't uncover any actual instances of
the problem.

This also uncovered the fact that AssertingVH<const X> didn't work, so I fixed
that too.

llvm-svn: 78400
2009-08-07 19:54:29 +00:00
Dan Gohman
0f6a4a4daa Teach ValueHandleBase to treat DenseMap's special Empty and Tombstone
values the same way it treats null pointers. This is needed to allow
CallbackVH to be used as a key in a DenseMap.

llvm-svn: 77695
2009-07-31 18:20:18 +00:00
Devang Patel
cef1863706 Fix comment.
llvm-svn: 77603
2009-07-30 17:25:33 +00:00
Dan Gohman
3817464c23 Add simplify_type specializations to allow WeakVH, AssertingVH, and
CallbackVH to participate in dyn_cast, isa, etc. without needing
an explicit conversion.

llvm-svn: 71087
2009-05-06 17:12:48 +00:00
Dan Gohman
6d1ffab07b Add an explicit keyword.
llvm-svn: 71022
2009-05-05 21:23:20 +00:00
Dan Gohman
dc96a23780 Apply Jeffrey Yasskin's CallbackVH patch, with minor tweaks from me
to make the copy constructor and destructor protected, and corresponding
adjustments to the unittests.

llvm-svn: 70644
2009-05-02 21:10:48 +00:00
Jeffrey Yasskin
114afdef8b Add tests for WeakVH and AssertingVH. These pointed out that the overloads for
the comparison operators were not only unnecessary in the presence of the
implicit conversion; they caused ambiguous overload errors. So I deleted them.

llvm-svn: 70243
2009-04-27 20:32:07 +00:00
Nick Lewycky
3e04213f1f Fix missing text in doxygen documentation.
llvm-svn: 69529
2009-04-19 18:20:21 +00:00
Chris Lattner
108305e9d3 Work around an apparent GCC miscompilation by specializing different,
this fixes a regression on some compilers from r68147.

llvm-svn: 68356
2009-04-03 00:26:01 +00:00
Chris Lattner
67af801e8b add missing *
llvm-svn: 68350
2009-04-02 23:53:03 +00:00
Chris Lattner
2dd3b48ac1 add a converting operator
llvm-svn: 68158
2009-03-31 23:09:51 +00:00
Chris Lattner
939313c44a Add two new classes: WeakVH and AssertingVH. These are both "ValueHandles",
which are effectively smart pointers to Value*'s.  They are both very light
weight and simple, and react to values being destroyed or being RAUW'd.

WeakVN does a best effort to follow a value around, including through RAUW 
operations and will get nulled out of the value is destroyed.  This is useful
for the eventual "metadata that references a value" work, because it is a
reference to a value that does not show up on its use_* list.

AssertingVH is a pointer that compiles down to a dumb raw pointer when 
assertions are disabled.  When enabled, it emits an assertion if the 
pointed-to value is destroyed while it is still being referenced.  This
is very useful for Maps and other things, and should have caught the recent
bugs in CallGraph and Reassociate, for example.

llvm-svn: 68149
2009-03-31 22:11:05 +00:00