diff options
| author | Owen Anderson <resistor@mac.com> | 2009-06-23 18:30:27 +0000 | 
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2009-06-23 18:30:27 +0000 | 
| commit | 9262d43c5dcb2e57aecbc71dee737ae4c6b469b6 (patch) | |
| tree | 5c8c239cb07e2aaed8ba0b6c06894844ac7e3939 /llvm | |
| parent | e324ceeced56b869323d2362620fb6dd3710a64a (diff) | |
| download | bcm5719-llvm-9262d43c5dcb2e57aecbc71dee737ae4c6b469b6.tar.gz bcm5719-llvm-9262d43c5dcb2e57aecbc71dee737ae4c6b469b6.zip  | |
Atomic ops that do arithmetic use signed arithmetic.
llvm-svn: 73980
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/System/Atomic.h | 8 | ||||
| -rw-r--r-- | llvm/include/llvm/Type.h | 4 | ||||
| -rw-r--r-- | llvm/lib/System/Atomic.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/VMCore/Mangler.cpp | 4 | 
4 files changed, 12 insertions, 12 deletions
diff --git a/llvm/include/llvm/System/Atomic.h b/llvm/include/llvm/System/Atomic.h index a94ad2d92e5..c0612f9976c 100644 --- a/llvm/include/llvm/System/Atomic.h +++ b/llvm/include/llvm/System/Atomic.h @@ -23,11 +23,11 @@ namespace llvm {      uint32_t CompareAndSwap32(volatile uint32_t* ptr,                              uint32_t new_value,                              uint32_t old_value); -    uint32_t AtomicIncrement32(volatile uint32_t* ptr); -    uint32_t AtomicDecrement32(volatile uint32_t* ptr); -    uint32_t AtomicAdd32(volatile uint32_t* ptr, uint32_t val); +    int32_t AtomicIncrement32(volatile int32_t* ptr); +    int32_t AtomicDecrement32(volatile int32_t* ptr); +    int32_t AtomicAdd32(volatile int32_t* ptr, int32_t val); -    uint64_t AtomicAdd64(volatile uint64_t* ptr, uint64_t val); +    int64_t AtomicAdd64(volatile int64_t* ptr, int64_t val);    }  } diff --git a/llvm/include/llvm/Type.h b/llvm/include/llvm/Type.h index 8c07b3e2a06..97d5043dc41 100644 --- a/llvm/include/llvm/Type.h +++ b/llvm/include/llvm/Type.h @@ -103,7 +103,7 @@ private:    /// has no AbstractTypeUsers, the type is deleted.  This is only sensical for    /// derived types.    /// -  mutable uint32_t RefCount; +  mutable int32_t RefCount;    const Type *getForwardedTypeInternal() const; @@ -347,7 +347,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. -    uint32_t Count = sys::AtomicDecrement32(&RefCount); +    int32_t Count = sys::AtomicDecrement32(&RefCount);      if (Count == 0 && AbstractTypeUsers.empty())        this->destroy();    } diff --git a/llvm/lib/System/Atomic.cpp b/llvm/lib/System/Atomic.cpp index 65e14697ede..fda27088da1 100644 --- a/llvm/lib/System/Atomic.cpp +++ b/llvm/lib/System/Atomic.cpp @@ -52,7 +52,7 @@ uint32_t sys::CompareAndSwap32(volatile uint32_t* ptr,  #endif  } -uint32_t sys::AtomicIncrement32(volatile uint32_t* ptr) { +int32_t sys::AtomicIncrement32(volatile int32_t* ptr) {  #if LLVM_MULTITHREADED==0    ++(*ptr);    return *ptr; @@ -65,7 +65,7 @@ uint32_t sys::AtomicIncrement32(volatile uint32_t* ptr) {  #endif  } -uint32_t sys::AtomicDecrement32(volatile uint32_t* ptr) { +int32_t sys::AtomicDecrement32(volatile int32_t* ptr) {  #if LLVM_MULTITHREADED==0    --(*ptr);    return *ptr; @@ -78,7 +78,7 @@ uint32_t sys::AtomicDecrement32(volatile uint32_t* ptr) {  #endif  } -uint32_t sys::AtomicAdd32(volatile uint32_t* ptr, uint32_t val) { +int32_t sys::AtomicAdd32(volatile int32_t* ptr, int32_t val) {  #if LLVM_MULTITHREADED==0    *ptr += val;    return *ptr; @@ -91,7 +91,7 @@ uint32_t sys::AtomicAdd32(volatile uint32_t* ptr, uint32_t val) {  #endif  } -uint64_t sys::AtomicAdd64(volatile uint64_t* ptr, uint64_t val) { +int64_t sys::AtomicAdd64(volatile int64_t* ptr, int64_t val) {  #if LLVM_MULTITHREADED==0    *ptr += val;    return *ptr; diff --git a/llvm/lib/VMCore/Mangler.cpp b/llvm/lib/VMCore/Mangler.cpp index 0f6f216ceb8..6be06d22168 100644 --- a/llvm/lib/VMCore/Mangler.cpp +++ b/llvm/lib/VMCore/Mangler.cpp @@ -165,9 +165,9 @@ std::string Mangler::getValueName(const GlobalValue *GV, const char * Suffix) {    } else if (!GV->hasName()) {      // Must mangle the global into a unique ID.      unsigned TypeUniqueID = getTypeID(GV->getType()); -    static uint32_t GlobalID = 0; +    static int32_t GlobalID = 0; -    unsigned OldID = GlobalID; +    int32_t OldID = GlobalID;      sys::AtomicIncrement32(&GlobalID);      Name = "__unnamed_" + utostr(TypeUniqueID) + "_" + utostr(OldID);  | 

