summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/Support/ValueHandle.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix TrackingVH to handle const Value subclasses.Dan Gohman2010-04-141-1/+1
| | | | llvm-svn: 101300
* add new apis for getting/setting !dbg metadata on Chris Lattner2010-03-311-2/+1
| | | | | | | | | instructions. In addition to being a convenience, they are faster than the old apis, particularly when not going from an MDKindID like people should be doing. llvm-svn: 99982
* Fix a major source of compile-time slowness at -O0 -g by optimizingChris Lattner2010-03-301-1/+1
| | | | | | | | | | | | | | the storage of !dbg metadata kinds in the instruction themselves. The on-the-side hash table works great for metadata that not-all instructions get, or for metadata that only exists when optimizing. But when compile-time is everything, it isn't great. I'm not super thrilled with the fact that this plops a TrackingVH in Instruction, because it grows it by 3 words. I'm investigating alternatives, but this should be a step in the right direction in any case. llvm-svn: 99957
* Remove isPod() from DenseMapInfo, splitting it out to its ownChris Lattner2009-12-151-4/+7
| | | | | | | | isPodLike type trait. This is a generally useful type trait for more than just DenseMap, and we really care about whether something acts like a pod, not whether it really is a pod. llvm-svn: 91421
* Clean up the JITResolver stub/callsite<->function maps.Jeffrey Yasskin2009-10-191-0/+25
| | | | | | | | | | | | | | | | | The JITResolver maps Functions to their canonical stubs and all callsites for lazily-compiled functions to their target Functions. To make Function destruction work, I'm going to need to remove all callsites on destruction, so this patch also adds the reverse mapping for that. There was an incorrect assumption in here that the only stub for a function would be the one caused by needing to lazily compile it, while x86-64 far calls and dlsym-stubs could also cause such stubs, but I didn't look for a test case that the assumption broke. This also adds DenseMapInfo<AssertingVH> so I can use DenseMaps instead of std::maps. llvm-svn: 84522
* More warnings patrol: Another unused argument and more implicitEric Christopher2009-10-171-1/+1
| | | | | | conversions. llvm-svn: 84382
* Fix http://llvm.org/PR5160, to let CallbackVHs modify other ValueHandles on theJeffrey Yasskin2009-10-121-2/+7
| | | | | | same Value without breaking things. llvm-svn: 83861
* add some WeakVH::operator='s. Without these, assigningChris Lattner2009-10-101-0/+9
| | | | | | | | a Value* to a WeakVH was constructing a temporary WeakVH (due to the implicit assignment operator). This avoids that cost. llvm-svn: 83704
* Add a TrackingVH value handle.Daniel Dunbar2009-09-221-3/+86
| | | | | | | | | | This is designed for tracking a value even when it might move (like WeakVH), but it is an error to delete the referenced value (unlike WeakVH0. TrackingVH is templated like AssertingVH on the tracked Value subclass, it is an error to RAUW a tracked value to an incompatible type. For implementation reasons the latter error is only diagnosed on accesses to a mis-RAUWed TrackingVH, because we don't want a virtual interface in a templated class. The former error is also only diagnosed on access, so that clients are allowed to delete a tracked value, as long as they don't use it. This makes it easier for the client to reason about destruction. llvm-svn: 82506
* Strip trailing whitespace.Daniel Dunbar2009-09-191-9/+9
| | | | llvm-svn: 82332
* RHS of assignment should be const reference.Daniel Dunbar2009-09-191-1/+1
| | | | llvm-svn: 82331
* To catch bugs like the one fixed inJeffrey Yasskin2009-08-071-2/+7
| | | | | | | | | | | | | 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
* Teach ValueHandleBase to treat DenseMap's special Empty and TombstoneDan Gohman2009-07-311-7/+14
| | | | | | | 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
* Fix comment.Devang Patel2009-07-301-2/+2
| | | | llvm-svn: 77603
* Add simplify_type specializations to allow WeakVH, AssertingVH, andDan Gohman2009-05-061-2/+37
| | | | | | | CallbackVH to participate in dyn_cast, isa, etc. without needing an explicit conversion. llvm-svn: 71087
* Add an explicit keyword.Dan Gohman2009-05-051-1/+2
| | | | llvm-svn: 71022
* Apply Jeffrey Yasskin's CallbackVH patch, with minor tweaks from meDan Gohman2009-05-021-1/+45
| | | | | | | to make the copy constructor and destructor protected, and corresponding adjustments to the unittests. llvm-svn: 70644
* Add tests for WeakVH and AssertingVH. These pointed out that the overloads forJeffrey Yasskin2009-04-271-42/+2
| | | | | | | 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
* Fix missing text in doxygen documentation.Nick Lewycky2009-04-191-1/+1
| | | | llvm-svn: 69529
* Work around an apparent GCC miscompilation by specializing different,Chris Lattner2009-04-031-0/+12
| | | | | | this fixes a regression on some compilers from r68147. llvm-svn: 68356
* add missing *Chris Lattner2009-04-021-2/+2
| | | | llvm-svn: 68350
* add a converting operatorChris Lattner2009-03-311-0/+3
| | | | llvm-svn: 68158
* Add two new classes: WeakVH and AssertingVH. These are both "ValueHandles", Chris Lattner2009-03-311-0/+217
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
OpenPOWER on IntegriCloud