[polly] fb7cf90 - Use nullptr instead of 0 or NULL (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 7 10:17:40 PST 2022


Author: Kazu Hirata
Date: 2022-01-07T10:17:29-08:00
New Revision: fb7cf90071da733e138ae6d39a0dd7efc96438f2

URL: https://github.com/llvm/llvm-project/commit/fb7cf90071da733e138ae6d39a0dd7efc96438f2
DIFF: https://github.com/llvm/llvm-project/commit/fb7cf90071da733e138ae6d39a0dd7efc96438f2.diff

LOG: Use nullptr instead of 0 or NULL (NFC)

Identified with modernize-use-nullptr.

Added: 
    

Modified: 
    llvm/include/llvm/ADT/ScopedHashTable.h
    mlir/include/mlir/IR/Diagnostics.h
    polly/include/polly/CodeGen/LoopGenerators.h
    polly/include/polly/ScopPass.h
    polly/lib/CodeGen/LoopGeneratorsKMP.cpp
    polly/lib/External/isl/include/isl/isl-noexceptions.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/ScopedHashTable.h b/llvm/include/llvm/ADT/ScopedHashTable.h
index a5e57c6a16c2e..48544961d095b 100644
--- a/llvm/include/llvm/ADT/ScopedHashTable.h
+++ b/llvm/include/llvm/ADT/ScopedHashTable.h
@@ -197,7 +197,7 @@ class ScopedHashTable {
 
   using iterator = ScopedHashTableIterator<K, V, KInfo>;
 
-  iterator end() { return iterator(0); }
+  iterator end() { return iterator(nullptr); }
 
   iterator begin(const K &Key) {
     typename DenseMap<K, ValTy*, KInfo>::iterator I =

diff  --git a/mlir/include/mlir/IR/Diagnostics.h b/mlir/include/mlir/IR/Diagnostics.h
index 0f7912d02ffca..8ccfe49f23c8b 100644
--- a/mlir/include/mlir/IR/Diagnostics.h
+++ b/mlir/include/mlir/IR/Diagnostics.h
@@ -62,16 +62,18 @@ class DiagnosticArgument {
   // Construct from a signed integer.
   template <typename T>
   explicit DiagnosticArgument(
-      T val, typename std::enable_if<std::is_signed<T>::value &&
-                                     std::numeric_limits<T>::is_integer &&
-                                     sizeof(T) <= sizeof(int64_t)>::type * = 0)
+      T val,
+      typename std::enable_if<std::is_signed<T>::value &&
+                              std::numeric_limits<T>::is_integer &&
+                              sizeof(T) <= sizeof(int64_t)>::type * = nullptr)
       : kind(DiagnosticArgumentKind::Integer), opaqueVal(int64_t(val)) {}
   // Construct from an unsigned integer.
   template <typename T>
   explicit DiagnosticArgument(
-      T val, typename std::enable_if<std::is_unsigned<T>::value &&
-                                     std::numeric_limits<T>::is_integer &&
-                                     sizeof(T) <= sizeof(uint64_t)>::type * = 0)
+      T val,
+      typename std::enable_if<std::is_unsigned<T>::value &&
+                              std::numeric_limits<T>::is_integer &&
+                              sizeof(T) <= sizeof(uint64_t)>::type * = nullptr)
       : kind(DiagnosticArgumentKind::Unsigned), opaqueVal(uint64_t(val)) {}
   // Construct from a string reference.
   explicit DiagnosticArgument(StringRef val)

diff  --git a/polly/include/polly/CodeGen/LoopGenerators.h b/polly/include/polly/CodeGen/LoopGenerators.h
index bb73f229d87c1..17207b8ea13a2 100644
--- a/polly/include/polly/CodeGen/LoopGenerators.h
+++ b/polly/include/polly/CodeGen/LoopGenerators.h
@@ -75,7 +75,7 @@ extern int PollyChunkSize;
 Value *createLoop(Value *LowerBound, Value *UpperBound, Value *Stride,
                   PollyIRBuilder &Builder, LoopInfo &LI, DominatorTree &DT,
                   BasicBlock *&ExitBlock, ICmpInst::Predicate Predicate,
-                  ScopAnnotator *Annotator = NULL, bool Parallel = false,
+                  ScopAnnotator *Annotator = nullptr, bool Parallel = false,
                   bool UseGuard = true, bool LoopVectDisabled = false);
 
 /// The ParallelLoopGenerator allows to create parallelized loops

diff  --git a/polly/include/polly/ScopPass.h b/polly/include/polly/ScopPass.h
index 7e5041e9fb54c..34eea0431f44b 100644
--- a/polly/include/polly/ScopPass.h
+++ b/polly/include/polly/ScopPass.h
@@ -162,7 +162,7 @@ class ScopPass : public RegionPass {
   Scop *S;
 
 protected:
-  explicit ScopPass(char &ID) : RegionPass(ID), S(0) {}
+  explicit ScopPass(char &ID) : RegionPass(ID), S(nullptr) {}
 
   /// runOnScop - This method must be overloaded to perform the
   /// desired Polyhedral transformation or analysis.

diff  --git a/polly/lib/CodeGen/LoopGeneratorsKMP.cpp b/polly/lib/CodeGen/LoopGeneratorsKMP.cpp
index 272f8ae828af1..335fc4007623f 100644
--- a/polly/lib/CodeGen/LoopGeneratorsKMP.cpp
+++ b/polly/lib/CodeGen/LoopGeneratorsKMP.cpp
@@ -517,8 +517,9 @@ GlobalVariable *ParallelLoopGeneratorKMP::createSourceLocation() {
         llvm::ArrayType::get(Builder.getInt8Ty(), /* Length */ 23);
 
     // Global Variable Definitions
-    GlobalVariable *StrVar = new GlobalVariable(
-        *M, ArrayType, true, GlobalValue::PrivateLinkage, 0, ".str.ident");
+    GlobalVariable *StrVar =
+        new GlobalVariable(*M, ArrayType, true, GlobalValue::PrivateLinkage,
+                           nullptr, ".str.ident");
     StrVar->setAlignment(llvm::Align(1));
 
     SourceLocDummy = new GlobalVariable(

diff  --git a/polly/lib/External/isl/include/isl/isl-noexceptions.h b/polly/lib/External/isl/include/isl/isl-noexceptions.h
index 26d5f3337018e..e5727532b2cf3 100644
--- a/polly/lib/External/isl/include/isl/isl-noexceptions.h
+++ b/polly/lib/External/isl/include/isl/isl-noexceptions.h
@@ -628,7 +628,7 @@ class ast_expr {
 private:
   template <typename T,
           typename = typename std::enable_if<std::is_same<
-                  const decltype(isl_ast_expr_get_type(NULL)),
+                  const decltype(isl_ast_expr_get_type(nullptr)),
                   const T>::value>::type>
   inline boolean isa_type(T subtype) const;
 public:
@@ -711,7 +711,7 @@ class ast_expr_op : public ast_expr {
 private:
   template <typename T,
           typename = typename std::enable_if<std::is_same<
-                  const decltype(isl_ast_expr_op_get_type(NULL)),
+                  const decltype(isl_ast_expr_op_get_type(nullptr)),
                   const T>::value>::type>
   inline boolean isa_type(T subtype) const;
 public:
@@ -1245,7 +1245,7 @@ class ast_node {
 private:
   template <typename T,
           typename = typename std::enable_if<std::is_same<
-                  const decltype(isl_ast_node_get_type(NULL)),
+                  const decltype(isl_ast_node_get_type(nullptr)),
                   const T>::value>::type>
   inline boolean isa_type(T subtype) const;
 public:
@@ -3557,7 +3557,7 @@ class schedule_node {
 private:
   template <typename T,
           typename = typename std::enable_if<std::is_same<
-                  const decltype(isl_schedule_node_get_type(NULL)),
+                  const decltype(isl_schedule_node_get_type(nullptr)),
                   const T>::value>::type>
   inline boolean isa_type(T subtype) const;
 public:


        


More information about the llvm-commits mailing list