Skip to content

Commit 28c9f99

Browse files
committed
Replace some NULL usage with nullptr
1 parent 6b4ca37 commit 28c9f99

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

mlir/lib/Tools/mlir-query/Parser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ bool Parser::parseMatcherExpressionImpl(VariantValue *Value) {
355355
DynMatcher *Result = S->actOnMatcherExpression(NameToken.Text, MatcherRange,
356356
extractFunction, Args, Error);
357357

358-
if (Result == NULL) {
358+
if (Result == nullptr) {
359359
// TODO: Add appropriate error.
360360
// Error->addError(NameToken.Range, Error->ET_ParserMatcherFailure)
361361
// << NameToken.Text;
@@ -451,11 +451,11 @@ DynMatcher *Parser::parseMatcherExpression(StringRef Code, Parser::Sema *S,
451451
VariantValue Value;
452452
if (!parseExpression(Code, S, &Value, Error)) {
453453

454-
return NULL;
454+
return nullptr;
455455
}
456456
if (!Value.isMatcher()) {
457457
Error->addError(SourceRange(), Error->ET_ParserNotAMatcher);
458-
return NULL;
458+
return nullptr;
459459
}
460460
// FIXME: remove clone
461461
return Value.getMatcher().clone();

mlir/lib/Tools/mlir-query/Parser.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Parser {
5656
// All the arguments passed here have already been processed.
5757
// MatcherName is the matcher name found by the parser.
5858
// Args is the argument list for the matcher.
59-
// Returns the matcher object constructed by the processor, or NULL
59+
// Returns the matcher object constructed by the processor, or nullptr
6060
// if an error occurred. In that case, Error will contain a
6161
// description of the error.
6262
// The caller takes ownership of the Matcher object returned.
@@ -74,7 +74,7 @@ class Parser {
7474
// use the overload below that takes a Sema.
7575

7676
// MatcherCode is the matcher expression to parse.
77-
// Returns the matcher object constructed, or NULL if an error occurred.
77+
// Returns the matcher object constructed, or nullptr if an error occurred.
7878
// In that case, Error will contain a description of the error.
7979
// The caller takes ownership of the DynMatcher object returned.
8080
static DynMatcher *parseMatcherExpression(StringRef MatcherCode,
@@ -86,7 +86,7 @@ class Parser {
8686

8787
// S is the Sema instance that will help the parser
8888
// construct the matchers.
89-
// Returns the matcher object constructed by the processor, or NULL
89+
// Returns the matcher object constructed by the processor, or nullptr
9090
// if an error occurred. In that case, Error will contain a
9191
// description of the error.
9292
// The caller takes ownership of the DynMatcher object returned.

mlir/lib/Tools/mlir-query/Registry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ DynMatcher *Registry::constructMatcher(StringRef MatcherName,
112112
if (it == RegistryData->constructors().end()) {
113113
Error->addError(NameRange, Error->ET_RegistryMatcherNotFound)
114114
<< MatcherName;
115-
return NULL;
115+
return nullptr;
116116
}
117117

118118
return it->second->run(NameRange, Args, Error);

mlir/lib/Tools/mlir-query/Registry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Registry {
3636
// values must be valid for the matcher requested. Otherwise, the function
3737
// will return an error.
3838

39-
// Returns the matcher if no error was found. NULL if the matcher is not
39+
// Returns the matcher if no error was found. nullptr if the matcher is not
4040
// found, or if the number of arguments or argument types do not
4141
// match the signature. In that case Error will contain the description
4242
// of the error.

0 commit comments

Comments
 (0)