diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-07 18:33:04 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-07 18:33:04 +0000 |
commit | be44bedb7fe330e36f5ed544aa48c59742a52185 (patch) | |
tree | 79e3d7e0aafc4352dafe175986671f4353c0c5e2 /lib/Support/Annotation.cpp | |
parent | 4b62237cdb1089ec0c9f3e364babaa48ff4b61bf (diff) | |
download | external_llvm-be44bedb7fe330e36f5ed544aa48c59742a52185.zip external_llvm-be44bedb7fe330e36f5ed544aa48c59742a52185.tar.gz external_llvm-be44bedb7fe330e36f5ed544aa48c59742a52185.tar.bz2 |
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
Diffstat (limited to 'lib/Support/Annotation.cpp')
-rw-r--r-- | lib/Support/Annotation.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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 FactMapType &getFactMap() { } static void eraseFromFactMap(unsigned ID) { - sys::SmartScopedWriter<true> Writer(&*AnnotationsLock); + sys::SmartScopedWriter<true> Writer(*AnnotationsLock); TheFactMap->erase(ID); } @@ -66,7 +66,7 @@ AnnotationID AnnotationManager::getID(const char *Name) { // Name -> ID 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 @@ AnnotationID AnnotationManager::getID(const char *Name, Factory Fact, // 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 @@ const char *AnnotationManager::getName(AnnotationID ID) { // ID -> Name 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); |