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
diff --git a/lib/Support/Annotation.cpp b/lib/Support/Annotation.cpp
index 4b5b97e..9f76256 100644
--- a/lib/Support/Annotation.cpp
+++ b/lib/Support/Annotation.cpp
@@ -55,7 +55,7 @@
 }
 
 static void eraseFromFactMap(unsigned ID) {
-  sys::SmartScopedWriter<true> Writer(&*AnnotationsLock);
+  sys::SmartScopedWriter<true> Writer(*AnnotationsLock);
   TheFactMap->erase(ID);
 }
 
@@ -66,7 +66,7 @@
   AnnotationsLock->reader_release();
   
   if (I == E) {
-    sys::SmartScopedWriter<true> Writer(&*AnnotationsLock);
+    sys::SmartScopedWriter<true> Writer(*AnnotationsLock);
     I = IDMap->find(Name);
     if (I == IDMap->end()) {
       unsigned newCount = sys::AtomicIncrement(&IDCounter);
@@ -91,7 +91,7 @@
 // only be used for debugging.
 //
 const char *AnnotationManager::getName(AnnotationID ID) {  // ID -> Name
-  sys::SmartScopedReader<true> Reader(&*AnnotationsLock);
+  sys::SmartScopedReader<true> Reader(*AnnotationsLock);
   IDMapType &TheMap = *IDMap;
   for (IDMapType::iterator I = TheMap.begin(); ; ++I) {
     assert(I != TheMap.end() && "Annotation ID is unknown!");
@@ -106,7 +106,7 @@
 void AnnotationManager::registerAnnotationFactory(AnnotationID ID, AnnFactory F,
                                                   void *ExtraData) {
   if (F) {
-    sys::SmartScopedWriter<true> Writer(&*AnnotationsLock);
+    sys::SmartScopedWriter<true> Writer(*AnnotationsLock);
     getFactMap()[ID.ID] = std::make_pair(F, ExtraData);
   } else {
     eraseFromFactMap(ID.ID);