Fix Clang-tidy modernize-use-nullptr warnings in examples and include directories...
[oota-llvm.git] / include / llvm / ADT / IntrusiveRefCntPtr.h
index 9b12d048a8b226eca0d449ce03b6aa311ed24e0d..8057ec10be00953e5ffcb3a1d6d857a85e9eefd0 100644 (file)
 #ifndef LLVM_ADT_INTRUSIVEREFCNTPTR_H
 #define LLVM_ADT_INTRUSIVEREFCNTPTR_H
 
-#include "llvm/Support/Casting.h"
-#include "llvm/Support/Compiler.h"
 #include <atomic>
-#include <memory>
+#include <cassert>
+#include <cstddef>
 
 namespace llvm {
 
@@ -155,7 +154,7 @@ public:
 
     template <class X>
     IntrusiveRefCntPtr(IntrusiveRefCntPtr<X>&& S) : Obj(S.get()) {
-      S.Obj = 0;
+      S.Obj = nullptr;
     }
 
     template <class X>
@@ -191,7 +190,7 @@ public:
     }
 
     void resetWithoutRelease() {
-      Obj = 0;
+      Obj = nullptr;
     }
 
   private:
@@ -268,6 +267,8 @@ public:
 // LLVM-style downcasting support for IntrusiveRefCntPtr objects
 //===----------------------------------------------------------------------===//
 
+  template <typename From> struct simplify_type;
+
   template<class T> struct simplify_type<IntrusiveRefCntPtr<T> > {
     typedef T* SimpleType;
     static SimpleType getSimplifiedValue(IntrusiveRefCntPtr<T>& Val) {