From a9d1f2c559ef4b2549e29288fe6944e68913ba0f Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 7 Jul 2009 18:33:04 +0000 Subject: Have scoped mutexes take referenes instead of pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74931 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Value.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/VMCore/Value.cpp') diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp index c952b78..e980a5d 100644 --- a/lib/VMCore/Value.cpp +++ b/lib/VMCore/Value.cpp @@ -430,7 +430,7 @@ void ValueHandleBase::AddToUseList() { if (VP->HasValueHandle) { // If this value already has a ValueHandle, then it must be in the // ValueHandles map already. - sys::SmartScopedReader Reader(&*ValueHandlesLock); + sys::SmartScopedReader Reader(*ValueHandlesLock); ValueHandleBase *&Entry = (*ValueHandles)[VP]; assert(Entry != 0 && "Value doesn't have any handles?"); AddToExistingUseList(&Entry); @@ -442,7 +442,7 @@ void ValueHandleBase::AddToUseList() { // reallocate itself, which would invalidate all of the PrevP pointers that // point into the old table. Handle this by checking for reallocation and // updating the stale pointers only if needed. - sys::SmartScopedWriter Writer(&*ValueHandlesLock); + sys::SmartScopedWriter Writer(*ValueHandlesLock); ValueHandlesTy &Handles = *ValueHandles; const void *OldBucketPtr = Handles.getPointerIntoBucketsArray(); @@ -484,7 +484,7 @@ 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. - sys::SmartScopedWriter Writer(&*ValueHandlesLock); + sys::SmartScopedWriter Writer(*ValueHandlesLock); ValueHandlesTy &Handles = *ValueHandles; if (Handles.isPointerIntoBucketsArray(PrevPtr)) { Handles.erase(VP); -- cgit v1.1