aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Type.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-22 01:17:43 +0000
committerChris Lattner <sabre@nondot.org>2009-12-22 01:17:43 +0000
commit8a8f81859563ba16af40d87fbcd146b32d6db2d8 (patch)
tree13d3b77ded81ee2a6eb1b91db3d01491a40f8e68 /include/llvm/Type.h
parentec72e32fb032cdf367f47ed3a953c3aa2fa93197 (diff)
downloadexternal_llvm-8a8f81859563ba16af40d87fbcd146b32d6db2d8.zip
external_llvm-8a8f81859563ba16af40d87fbcd146b32d6db2d8.tar.gz
external_llvm-8a8f81859563ba16af40d87fbcd146b32d6db2d8.tar.bz2
types don't need atomic inc/dec, they are local to an llvmcontext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91873 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Type.h')
-rw-r--r--include/llvm/Type.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h
index 752635c..47a62f8 100644
--- a/include/llvm/Type.h
+++ b/include/llvm/Type.h
@@ -7,14 +7,12 @@
//
//===----------------------------------------------------------------------===//
-
#ifndef LLVM_TYPE_H
#define LLVM_TYPE_H
#include "llvm/AbstractTypeUser.h"
#include "llvm/Support/Casting.h"
#include "llvm/System/DataTypes.h"
-#include "llvm/System/Atomic.h"
#include "llvm/ADT/GraphTraits.h"
#include <string>
#include <vector>
@@ -104,7 +102,7 @@ private:
/// has no AbstractTypeUsers, the type is deleted. This is only sensical for
/// derived types.
///
- mutable sys::cas_flag RefCount;
+ mutable unsigned RefCount;
/// Context - This refers to the LLVMContext in which this type was uniqued.
LLVMContext &Context;
@@ -401,7 +399,7 @@ public:
void addRef() const {
assert(isAbstract() && "Cannot add a reference to a non-abstract type!");
- sys::AtomicIncrement(&RefCount);
+ ++RefCount;
}
void dropRef() const {
@@ -410,8 +408,7 @@ public:
// If this is the last PATypeHolder using this object, and there are no
// PATypeHandles using it, the type is dead, delete it now.
- sys::cas_flag OldCount = sys::AtomicDecrement(&RefCount);
- if (OldCount == 0 && AbstractTypeUsers.empty())
+ if (RefCount-- == 0 && AbstractTypeUsers.empty())
this->destroy();
}