summaryrefslogtreecommitdiff
path: root/unittests/IR/ValueHandleTest.cpp
AgeCommit message (Collapse)Author
2017-05-01Add a new WeakVH value handle; NFCSanjoy Das
This relands r301425. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301813 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-01Rename WeakVH to WeakTrackingVH; NFCSanjoy Das
This relands r301424. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301812 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-01Emulate TrackingVH using WeakVHSanjoy Das
Summary: This frees up one slot in the HandleBaseKind enum, which I will use later to add a new kind of value handle. The size of the HandleBaseKind enum is important because we store a HandleBaseKind in the low two bits of a (in the worst case) 4 byte aligned pointer. Reviewers: davide, chandlerc Subscribers: mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D32634 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301809 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26Reverts commit r301424, r301425 and r301426Sanjoy Das
Commits were: "Use WeakVH instead of WeakTrackingVH in AliasSetTracker's UnkownInsts" "Add a new WeakVH value handle; NFC" "Rename WeakVH to WeakTrackingVH; NFC" The changes assumed pointers are 8 byte aligned on all architectures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301429 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26Add a new WeakVH value handle; NFCSanjoy Das
Summary: 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301425 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26Rename WeakVH to WeakTrackingVH; NFCSanjoy Das
Summary: I plan to use WeakVH to mean "nulls itself out on deletion, but does not track RAUW" in a subsequent commit. Reviewers: dblaikie, davide Reviewed By: davide Subscribers: arsenm, mehdi_amini, mcrosier, mzolotukhin, jfb, llvm-commits, nhaehnle Differential Revision: https://reviews.llvm.org/D32266 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301424 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24[PM] Introduce a PoisoningVH as a (more expensive) alternative toChandler Carruth
AssertingVH that delays any reported error until the handle is *used*. 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. Differential Revision: https://reviews.llvm.org/D29061 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292925 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-14Remove every uses of getGlobalContext() in LLVM (but the C API)Mehdi Amini
At the same time, fixes InstructionsTest::CastInst unittest: yes you can leave the IR in an invalid state and exit when you don't destroy the context (like the global one), no longer now. This is the first part of http://reviews.llvm.org/D19094 From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266379 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are ↵David Blaikie
deprecated in C++11 Various value handles needed to be copy constructible and copy assignable (mostly for their use in DenseMap). But to avoid an API that might allow accidental slicing, make these members protected in the base class and make derived classes final (the special members become implicitly public there - but disallowing further derived classes that might be sliced to the intermediate type). Might be worth having a warning a bit like -Wnon-virtual-dtor that catches public move/copy assign/ctors in classes with virtual functions. (suppressable in the same way - by making them protected in the base, and making the derived classes final) Could be fancier and only diagnose them when they're actually called, potentially. Also allow a few default implementations where custom implementations (especially with non-standard return types) were implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243909 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22Replace std::auto_ptr with std::unique_ptrDavid Blaikie
std::auto_ptr is deprecated in GCC 5.0, and we are already using std::unique_ptr all over the place. Patch by Xan López. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235479 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-11Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko
The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' \ -j=32 -fix -format http://reviews.llvm.org/D8925 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234679 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08[C++11] Use 'nullptr'.Craig Topper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210442 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-06Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles
This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203083 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04[Modules] Move ValueHandle into the IR library where Value itself lives.Chandler Carruth
Move the test for this class into the IR unittests as well. This uncovers that ValueMap too is in the IR library. Ironically, the unittest for ValueMap is useless in the Support library (honestly, so was the ValueHandle test) and so it already lives in the IR unittests. Mmmm, tasty layering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202821 91177308-0d34-0410-b5e6-96231b3b80d8