[ dwarfdump ] Add symbolic dump of known DWARF attribute values.
[oota-llvm.git] / include / llvm / Support / StringPool.h
index de05e0b547a1bf15f2a427fac36e7ae3d23ecbc8..3e0465340c3b472a32cf38124ea695d1681f6ba5 100644 (file)
 #ifndef LLVM_SUPPORT_STRINGPOOL_H
 #define LLVM_SUPPORT_STRINGPOOL_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/ADT/StringMap.h"
-#include <new>
 #include <cassert>
+#include <new>
 
 namespace llvm {
 
@@ -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