summaryrefslogtreecommitdiff
path: root/include/llvm/Support/ValueHandle.h
Commit message (Collapse)AuthorAge
* Cleanup the simplify_type implementation.Rafael Espindola2013-03-27
| | | | | | | | | | | | | | | | | | | | As far as simplify_type is concerned, there are 3 kinds of smart pointers: * const correct: A 'const MyPtr<int> &' produces a 'const int*'. A 'MyPtr<int> &' produces a 'int *'. * always const: Even a 'MyPtr<int> &' produces a 'const int*'. * no const: Even a 'const MyPtr<int> &' produces a 'int*'. This patch then does the following: * Removes the unused specializations. Since they are unused, it is hard to know which kind should be implemented. * Make sure we don't drop const. * Fix the default forwarding so that const correct pointer only need one specialization. * Simplifies the existing specializations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178147 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-02
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark unimplemented copy constructors and copy assignment operators as ↵Craig Topper2012-09-17
| | | | | | LLVM_DELETED_FUNCTION. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164014 91177308-0d34-0410-b5e6-96231b3b80d8
* LICM uses AliasSet information to hoist and sink instructions. However, ↵Nadav Rotem2012-08-13
| | | | | | | | | | | | | | other passes, such as LoopRotate may invalidate its AliasSet because SSAUpdater does not update the AliasSet properly. This patch teaches SSAUpdater to notify AliasSet that it made changes. The testcase in PR12901 is too big to be useful and I could not reduce it to a normal size. rdar://11872059 PR12901 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161803 91177308-0d34-0410-b5e6-96231b3b80d8
* Move CallbackVHs dtor inline, it can be devirtualized in many cases. Move ↵Benjamin Kramer2012-05-19
| | | | | | the other virtual methods out of line as they are only called from within Value.cpp anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157123 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow subclasses of the ValueHandleBase to store information as part of theBill Wendling2012-04-08
| | | | | | | | value pointer by making the value pointer into a pointer-int pair with 2 bits available for flags. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154279 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r122114 (CallbackVH observing use-list changes) because it caused ↵Owen Anderson2010-12-20
| | | | | | severe slowdowns on the Linux self-host configuration. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122279 91177308-0d34-0410-b5e6-96231b3b80d8
* Header warning patrol.Eric Christopher2010-12-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122152 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to CallbackVH to receive notification when a Value's use-list ↵Owen Anderson2010-12-18
| | | | | | changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122114 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix TrackingVH to handle const Value subclasses.Dan Gohman2010-04-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101300 91177308-0d34-0410-b5e6-96231b3b80d8
* add new apis for getting/setting !dbg metadata on Chris Lattner2010-03-31
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99982 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a major source of compile-time slowness at -O0 -g by optimizingChris Lattner2010-03-30
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99957 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove isPod() from DenseMapInfo, splitting it out to its ownChris Lattner2009-12-15
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91421 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the JITResolver stub/callsite<->function maps.Jeffrey Yasskin2009-10-19
| | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84522 91177308-0d34-0410-b5e6-96231b3b80d8
* More warnings patrol: Another unused argument and more implicitEric Christopher2009-10-17
| | | | | | | conversions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84382 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix http://llvm.org/PR5160, to let CallbackVHs modify other ValueHandles on theJeffrey Yasskin2009-10-12
| | | | | | | same Value without breaking things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83861 91177308-0d34-0410-b5e6-96231b3b80d8
* add some WeakVH::operator='s. Without these, assigningChris Lattner2009-10-10
| | | | | | | | | a Value* to a WeakVH was constructing a temporary WeakVH (due to the implicit assignment operator). This avoids that cost. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83704 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a TrackingVH value handle.Daniel Dunbar2009-09-22
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82506 91177308-0d34-0410-b5e6-96231b3b80d8
* Strip trailing whitespace.Daniel Dunbar2009-09-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82332 91177308-0d34-0410-b5e6-96231b3b80d8
* RHS of assignment should be const reference.Daniel Dunbar2009-09-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82331 91177308-0d34-0410-b5e6-96231b3b80d8
* To catch bugs like the one fixed inJeffrey Yasskin2009-08-07
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78400 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ValueHandleBase to treat DenseMap's special Empty and TombstoneDan Gohman2009-07-31
| | | | | | | | values the same way it treats null pointers. This is needed to allow CallbackVH to be used as a key in a DenseMap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77695 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment.Devang Patel2009-07-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77603 91177308-0d34-0410-b5e6-96231b3b80d8
* Add simplify_type specializations to allow WeakVH, AssertingVH, andDan Gohman2009-05-06
| | | | | | | | CallbackVH to participate in dyn_cast, isa, etc. without needing an explicit conversion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71087 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an explicit keyword.Dan Gohman2009-05-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71022 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply Jeffrey Yasskin's CallbackVH patch, with minor tweaks from meDan Gohman2009-05-02
| | | | | | | | to make the copy constructor and destructor protected, and corresponding adjustments to the unittests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70644 91177308-0d34-0410-b5e6-96231b3b80d8
* Add tests for WeakVH and AssertingVH. These pointed out that the overloads forJeffrey Yasskin2009-04-27
| | | | | | | | the comparison operators were not only unnecessary in the presence of the implicit conversion; they caused ambiguous overload errors. So I deleted them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70243 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix missing text in doxygen documentation.Nick Lewycky2009-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69529 91177308-0d34-0410-b5e6-96231b3b80d8
* Work around an apparent GCC miscompilation by specializing different,Chris Lattner2009-04-03
| | | | | | | this fixes a regression on some compilers from r68147. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68356 91177308-0d34-0410-b5e6-96231b3b80d8
* add missing *Chris Lattner2009-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68350 91177308-0d34-0410-b5e6-96231b3b80d8
* add a converting operatorChris Lattner2009-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68158 91177308-0d34-0410-b5e6-96231b3b80d8
* Add two new classes: WeakVH and AssertingVH. These are both "ValueHandles", Chris Lattner2009-03-31
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68149 91177308-0d34-0410-b5e6-96231b3b80d8