aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support/StringPool.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2014-11-24 09:08:18 +0000
committerDimitry Andric <dim@FreeBSD.org>2014-11-24 09:08:18 +0000
commit5ca98fd98791947eba83a1ed3f2c8191ef7afa6c (patch)
treef5944309621cee4fe0976be6f9ac619b7ebfc4c2 /include/llvm/Support/StringPool.h
parent68bcb7db193e4bc81430063148253d30a791023e (diff)
Diffstat (limited to 'include/llvm/Support/StringPool.h')
-rw-r--r--include/llvm/Support/StringPool.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/llvm/Support/StringPool.h b/include/llvm/Support/StringPool.h
index 71adbc5342e2..3e0465340c3b 100644
--- a/include/llvm/Support/StringPool.h
+++ b/include/llvm/Support/StringPool.h
@@ -29,6 +29,7 @@
#ifndef LLVM_SUPPORT_STRINGPOOL_H
#define LLVM_SUPPORT_STRINGPOOL_H
+#include "llvm/Support/Compiler.h"
#include "llvm/ADT/StringMap.h"
#include <cassert>
#include <new>
@@ -48,7 +49,7 @@ namespace llvm {
unsigned Refcount; ///< Number of referencing PooledStringPtrs.
public:
- PooledString() : Pool(0), Refcount(0) { }
+ PooledString() : Pool(nullptr), Refcount(0) { }
};
friend class PooledStringPtr;
@@ -81,7 +82,7 @@ namespace llvm {
entry_t *S;
public:
- PooledStringPtr() : S(0) {}
+ PooledStringPtr() : S(nullptr) {}
explicit PooledStringPtr(entry_t *E) : S(E) {
if (S) ++S->getValue().Refcount;
@@ -107,7 +108,7 @@ namespace llvm {
S->getValue().Pool->InternTable.remove(S);
S->Destroy();
}
- S = 0;
+ S = nullptr;
}
~PooledStringPtr() { clear(); }
@@ -128,10 +129,10 @@ namespace llvm {
}
inline const char *operator*() const { return begin(); }
- inline operator bool() const { return S != 0; }
+ inline LLVM_EXPLICIT operator bool() const { return S != nullptr; }
- inline bool operator==(const PooledStringPtr &That) { return S == That.S; }
- inline bool operator!=(const PooledStringPtr &That) { return S != That.S; }
+ inline bool operator==(const PooledStringPtr &That) const { return S == That.S; }
+ inline bool operator!=(const PooledStringPtr &That) const { return S != That.S; }
};
} // End llvm namespace