Skip to content

Commit fb7cf90

Browse files
Use nullptr instead of 0 or NULL (NFC)
Identified with modernize-use-nullptr.
1 parent d51e347 commit fb7cf90

File tree

6 files changed

+18
-15
lines changed

6 files changed

+18
-15
lines changed

llvm/include/llvm/ADT/ScopedHashTable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ class ScopedHashTable {
197197

198198
using iterator = ScopedHashTableIterator<K, V, KInfo>;
199199

200-
iterator end() { return iterator(0); }
200+
iterator end() { return iterator(nullptr); }
201201

202202
iterator begin(const K &Key) {
203203
typename DenseMap<K, ValTy*, KInfo>::iterator I =

mlir/include/mlir/IR/Diagnostics.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,18 @@ class DiagnosticArgument {
6262
// Construct from a signed integer.
6363
template <typename T>
6464
explicit DiagnosticArgument(
65-
T val, typename std::enable_if<std::is_signed<T>::value &&
66-
std::numeric_limits<T>::is_integer &&
67-
sizeof(T) <= sizeof(int64_t)>::type * = 0)
65+
T val,
66+
typename std::enable_if<std::is_signed<T>::value &&
67+
std::numeric_limits<T>::is_integer &&
68+
sizeof(T) <= sizeof(int64_t)>::type * = nullptr)
6869
: kind(DiagnosticArgumentKind::Integer), opaqueVal(int64_t(val)) {}
6970
// Construct from an unsigned integer.
7071
template <typename T>
7172
explicit DiagnosticArgument(
72-
T val, typename std::enable_if<std::is_unsigned<T>::value &&
73-
std::numeric_limits<T>::is_integer &&
74-
sizeof(T) <= sizeof(uint64_t)>::type * = 0)
73+
T val,
74+
typename std::enable_if<std::is_unsigned<T>::value &&
75+
std::numeric_limits<T>::is_integer &&
76+
sizeof(T) <= sizeof(uint64_t)>::type * = nullptr)
7577
: kind(DiagnosticArgumentKind::Unsigned), opaqueVal(uint64_t(val)) {}
7678
// Construct from a string reference.
7779
explicit DiagnosticArgument(StringRef val)

polly/include/polly/CodeGen/LoopGenerators.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ extern int PollyChunkSize;
7575
Value *createLoop(Value *LowerBound, Value *UpperBound, Value *Stride,
7676
PollyIRBuilder &Builder, LoopInfo &LI, DominatorTree &DT,
7777
BasicBlock *&ExitBlock, ICmpInst::Predicate Predicate,
78-
ScopAnnotator *Annotator = NULL, bool Parallel = false,
78+
ScopAnnotator *Annotator = nullptr, bool Parallel = false,
7979
bool UseGuard = true, bool LoopVectDisabled = false);
8080

8181
/// The ParallelLoopGenerator allows to create parallelized loops

polly/include/polly/ScopPass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class ScopPass : public RegionPass {
162162
Scop *S;
163163

164164
protected:
165-
explicit ScopPass(char &ID) : RegionPass(ID), S(0) {}
165+
explicit ScopPass(char &ID) : RegionPass(ID), S(nullptr) {}
166166

167167
/// runOnScop - This method must be overloaded to perform the
168168
/// desired Polyhedral transformation or analysis.

polly/lib/CodeGen/LoopGeneratorsKMP.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,9 @@ GlobalVariable *ParallelLoopGeneratorKMP::createSourceLocation() {
517517
llvm::ArrayType::get(Builder.getInt8Ty(), /* Length */ 23);
518518

519519
// Global Variable Definitions
520-
GlobalVariable *StrVar = new GlobalVariable(
521-
*M, ArrayType, true, GlobalValue::PrivateLinkage, 0, ".str.ident");
520+
GlobalVariable *StrVar =
521+
new GlobalVariable(*M, ArrayType, true, GlobalValue::PrivateLinkage,
522+
nullptr, ".str.ident");
522523
StrVar->setAlignment(llvm::Align(1));
523524

524525
SourceLocDummy = new GlobalVariable(

polly/lib/External/isl/include/isl/isl-noexceptions.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ class ast_expr {
628628
private:
629629
template <typename T,
630630
typename = typename std::enable_if<std::is_same<
631-
const decltype(isl_ast_expr_get_type(NULL)),
631+
const decltype(isl_ast_expr_get_type(nullptr)),
632632
const T>::value>::type>
633633
inline boolean isa_type(T subtype) const;
634634
public:
@@ -711,7 +711,7 @@ class ast_expr_op : public ast_expr {
711711
private:
712712
template <typename T,
713713
typename = typename std::enable_if<std::is_same<
714-
const decltype(isl_ast_expr_op_get_type(NULL)),
714+
const decltype(isl_ast_expr_op_get_type(nullptr)),
715715
const T>::value>::type>
716716
inline boolean isa_type(T subtype) const;
717717
public:
@@ -1245,7 +1245,7 @@ class ast_node {
12451245
private:
12461246
template <typename T,
12471247
typename = typename std::enable_if<std::is_same<
1248-
const decltype(isl_ast_node_get_type(NULL)),
1248+
const decltype(isl_ast_node_get_type(nullptr)),
12491249
const T>::value>::type>
12501250
inline boolean isa_type(T subtype) const;
12511251
public:
@@ -3557,7 +3557,7 @@ class schedule_node {
35573557
private:
35583558
template <typename T,
35593559
typename = typename std::enable_if<std::is_same<
3560-
const decltype(isl_schedule_node_get_type(NULL)),
3560+
const decltype(isl_schedule_node_get_type(nullptr)),
35613561
const T>::value>::type>
35623562
inline boolean isa_type(T subtype) const;
35633563
public:

0 commit comments

Comments
 (0)