diff options
| author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2017-05-01 17:07:54 +0000 |
|---|---|---|
| committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2017-05-01 17:07:54 +0000 |
| commit | f1c0eafd5b10d33d957457ef292c56e6bab17938 (patch) | |
| tree | 0586891ec17798fd6c0881dec20acf804a342c5b /llvm/lib | |
| parent | e6bca0eecbd31d9dd65040b212326330c9cf2655 (diff) | |
| download | bcm5719-llvm-f1c0eafd5b10d33d957457ef292c56e6bab17938.tar.gz bcm5719-llvm-f1c0eafd5b10d33d957457ef292c56e6bab17938.zip | |
Add a new WeakVH value handle; NFC
This relands r301425.
llvm-svn: 301813
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/IR/Value.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp index bde5b3a8ce0..02b40c93b5d 100644 --- a/llvm/lib/IR/Value.cpp +++ b/llvm/lib/IR/Value.cpp @@ -820,8 +820,10 @@ void ValueHandleBase::ValueIsDeleted(Value *V) { switch (Entry->getKind()) { case Assert: break; + case Weak: case WeakTracking: - // WeakTracking just goes to null, which will unlink it from the list. + // WeakTracking and Weak just go to null, which unlinks them + // from the list. Entry->operator=(nullptr); break; case Callback: @@ -869,7 +871,8 @@ void ValueHandleBase::ValueIsRAUWd(Value *Old, Value *New) { switch (Entry->getKind()) { case Assert: - // Asserting handle does not follow RAUW implicitly. + case Weak: + // Asserting and Weak handles do not follow RAUW implicitly. break; case WeakTracking: // Weak goes to the new value, which will unlink it from Old's list. |

