mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
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
This commit is contained in:
@@ -242,18 +242,18 @@ static StringPool *GCNamePool;
|
||||
static ManagedStatic<sys::SmartRWMutex<true> > GCLock;
|
||||
|
||||
bool Function::hasGC() const {
|
||||
sys::SmartScopedReader<true> Reader(&*GCLock);
|
||||
sys::SmartScopedReader<true> Reader(*GCLock);
|
||||
return GCNames && GCNames->count(this);
|
||||
}
|
||||
|
||||
const char *Function::getGC() const {
|
||||
assert(hasGC() && "Function has no collector");
|
||||
sys::SmartScopedReader<true> Reader(&*GCLock);
|
||||
sys::SmartScopedReader<true> Reader(*GCLock);
|
||||
return *(*GCNames)[this];
|
||||
}
|
||||
|
||||
void Function::setGC(const char *Str) {
|
||||
sys::SmartScopedWriter<true> Writer(&*GCLock);
|
||||
sys::SmartScopedWriter<true> Writer(*GCLock);
|
||||
if (!GCNamePool)
|
||||
GCNamePool = new StringPool();
|
||||
if (!GCNames)
|
||||
@@ -262,7 +262,7 @@ void Function::setGC(const char *Str) {
|
||||
}
|
||||
|
||||
void Function::clearGC() {
|
||||
sys::SmartScopedWriter<true> Writer(&*GCLock);
|
||||
sys::SmartScopedWriter<true> Writer(*GCLock);
|
||||
if (GCNames) {
|
||||
GCNames->erase(this);
|
||||
if (GCNames->empty()) {
|
||||
|
||||
Reference in New Issue
Block a user