diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2015-01-09 00:48:47 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2015-01-09 00:48:47 +0000 |
commit | f4ea3d3d9c624813f03679021a064687b56f7c08 (patch) | |
tree | 804c524390dacc2b5b7d9fa9ed695bc33b1614c6 /llvm/lib/IR/Value.cpp | |
parent | 9aa7e8e9ffbef6989fa9aeb4e06fe8b0c38a75b7 (diff) | |
download | bcm5719-llvm-f4ea3d3d9c624813f03679021a064687b56f7c08.tar.gz bcm5719-llvm-f4ea3d3d9c624813f03679021a064687b56f7c08.zip |
Cleaup ValueHandle to no longer keep a PointerIntPair for the Value*.
This was used previously for metadata but is no longer needed there. Not
doing this simplifies ValueHandle and will make it easier to fix things
like AssertingVH's DenseMapInfo.
llvm-svn: 225487
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r-- | llvm/lib/IR/Value.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp index a9e6a72f0ac..5f7e258441a 100644 --- a/llvm/lib/IR/Value.cpp +++ b/llvm/lib/IR/Value.cpp @@ -645,7 +645,7 @@ void ValueHandleBase::AddToExistingUseList(ValueHandleBase **List) { setPrevPtr(List); if (Next) { Next->setPrevPtr(&Next); - assert(VP.getPointer() == Next->VP.getPointer() && "Added to wrong list?"); + assert(V == Next->V && "Added to wrong list?"); } } @@ -660,14 +660,14 @@ void ValueHandleBase::AddToExistingUseListAfter(ValueHandleBase *List) { } void ValueHandleBase::AddToUseList() { - assert(VP.getPointer() && "Null pointer doesn't have a use list!"); + assert(V && "Null pointer doesn't have a use list!"); - LLVMContextImpl *pImpl = VP.getPointer()->getContext().pImpl; + LLVMContextImpl *pImpl = V->getContext().pImpl; - if (VP.getPointer()->HasValueHandle) { + if (V->HasValueHandle) { // If this value already has a ValueHandle, then it must be in the // ValueHandles map already. - ValueHandleBase *&Entry = pImpl->ValueHandles[VP.getPointer()]; + ValueHandleBase *&Entry = pImpl->ValueHandles[V]; assert(Entry && "Value doesn't have any handles?"); AddToExistingUseList(&Entry); return; @@ -681,10 +681,10 @@ void ValueHandleBase::AddToUseList() { DenseMap<Value*, ValueHandleBase*> &Handles = pImpl->ValueHandles; const void *OldBucketPtr = Handles.getPointerIntoBucketsArray(); - ValueHandleBase *&Entry = Handles[VP.getPointer()]; + ValueHandleBase *&Entry = Handles[V]; assert(!Entry && "Value really did already have handles?"); AddToExistingUseList(&Entry); - VP.getPointer()->HasValueHandle = true; + V->HasValueHandle = true; // If reallocation didn't happen or if this was the first insertion, don't // walk the table. @@ -696,14 +696,14 @@ void ValueHandleBase::AddToUseList() { // Okay, reallocation did happen. Fix the Prev Pointers. for (DenseMap<Value*, ValueHandleBase*>::iterator I = Handles.begin(), E = Handles.end(); I != E; ++I) { - assert(I->second && I->first == I->second->VP.getPointer() && + assert(I->second && I->first == I->second->V && "List invariant broken!"); I->second->setPrevPtr(&I->second); } } void ValueHandleBase::RemoveFromUseList() { - assert(VP.getPointer() && VP.getPointer()->HasValueHandle && + assert(V && V->HasValueHandle && "Pointer doesn't have a use list!"); // Unlink this from its use list. @@ -720,11 +720,11 @@ void ValueHandleBase::RemoveFromUseList() { // If the Next pointer was null, then it is possible that this was the last // ValueHandle watching VP. If so, delete its entry from the ValueHandles // map. - LLVMContextImpl *pImpl = VP.getPointer()->getContext().pImpl; + LLVMContextImpl *pImpl = V->getContext().pImpl; DenseMap<Value*, ValueHandleBase*> &Handles = pImpl->ValueHandles; if (Handles.isPointerIntoBucketsArray(PrevPtr)) { - Handles.erase(VP.getPointer()); - VP.getPointer()->HasValueHandle = false; + Handles.erase(V); + V->HasValueHandle = false; } } |