diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-05-21 06:02:52 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-05-21 06:02:52 +0000 |
commit | 161e4db52f657eac37d89e655c0772f98e97d989 (patch) | |
tree | 7e200e2d8296209044601808c2308c8ddb67bdbb /clang/lib/Parse/ParseExprCXX.cpp | |
parent | 85a0321b150e09f06f5ae85ce72c1e2e4793f2d1 (diff) | |
download | bcm5719-llvm-161e4db52f657eac37d89e655c0772f98e97d989.tar.gz bcm5719-llvm-161e4db52f657eac37d89e655c0772f98e97d989.zip |
[C++11] Use 'nullptr'. Parser edition.
llvm-svn: 209275
Diffstat (limited to 'clang/lib/Parse/ParseExprCXX.cpp')
-rw-r--r-- | clang/lib/Parse/ParseExprCXX.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp index 26ff273705b..ff19826678b 100644 --- a/clang/lib/Parse/ParseExprCXX.cpp +++ b/clang/lib/Parse/ParseExprCXX.cpp @@ -207,7 +207,7 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS, } if (LastII) - *LastII = 0; + *LastII = nullptr; bool HasScopeSpecifier = false; @@ -462,7 +462,7 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS, CheckForLParenAfterColonColon(); bool IsCorrectedToColon = false; - bool *CorrectionFlagPtr = ColonIsSacred ? &IsCorrectedToColon : 0; + bool *CorrectionFlagPtr = ColonIsSacred ? &IsCorrectedToColon : nullptr; if (Actions.ActOnCXXNestedNameSpecifier(getCurScope(), II, IdLoc, CCLoc, ObjectType, EnteringContext, SS, false, CorrectionFlagPtr)) { @@ -793,7 +793,7 @@ Optional<unsigned> Parser::ParseLambdaIntroducer(LambdaIntroducer &Intro, // Parse capture. LambdaCaptureKind Kind = LCK_ByCopy; SourceLocation Loc; - IdentifierInfo* Id = 0; + IdentifierInfo *Id = nullptr; SourceLocation EllipsisLoc; ExprResult Init; @@ -1092,7 +1092,7 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer( DynamicExceptionRanges.data(), DynamicExceptions.size(), NoexceptExpr.isUsable() ? - NoexceptExpr.get() : 0, + NoexceptExpr.get() : nullptr, LParenLoc, FunLocalRangeEnd, D, TrailingReturnType), Attr, DeclEndLoc); @@ -1144,7 +1144,7 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer( D.AddTypeInfo(DeclaratorChunk::getFunction(/*hasProto=*/true, /*isAmbiguous=*/false, /*LParenLoc=*/NoLoc, - /*Params=*/0, + /*Params=*/nullptr, /*NumParams=*/0, /*EllipsisLoc=*/NoLoc, /*RParenLoc=*/NoLoc, @@ -1156,10 +1156,10 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer( MutableLoc, EST_None, /*ESpecLoc=*/NoLoc, - /*Exceptions=*/0, - /*ExceptionRanges=*/0, + /*Exceptions=*/nullptr, + /*ExceptionRanges=*/nullptr, /*NumExceptions=*/0, - /*NoexceptExpr=*/0, + /*NoexceptExpr=*/nullptr, DeclLoc, DeclEndLoc, D, TrailingReturnType), Attr, DeclEndLoc); @@ -1201,7 +1201,7 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer( /// ExprResult Parser::ParseCXXCasts() { tok::TokenKind Kind = Tok.getKind(); - const char *CastName = 0; // For error messages + const char *CastName = nullptr; // For error messages switch (Kind) { default: llvm_unreachable("Unknown C++ cast!"); @@ -1417,7 +1417,7 @@ Parser::ParseCXXPseudoDestructor(ExprArg Base, SourceLocation OpLoc, assert(Tok.is(tok::coloncolon) &&"ParseOptionalCXXScopeSpecifier fail"); CCLoc = ConsumeToken(); } else { - FirstTypeName.setIdentifier(0, SourceLocation()); + FirstTypeName.setIdentifier(nullptr, SourceLocation()); } // Parse the tilde. @@ -1489,7 +1489,7 @@ ExprResult Parser::ParseThrowExpression() { case tok::r_brace: case tok::colon: case tok::comma: - return Actions.ActOnCXXThrow(getCurScope(), ThrowLoc, 0); + return Actions.ActOnCXXThrow(getCurScope(), ThrowLoc, nullptr); default: ExprResult Expr(ParseAssignmentExpression()); @@ -1608,7 +1608,7 @@ bool Parser::ParseCXXCondition(ExprResult &ExprOut, // Parse the expression. ExprOut = ParseExpression(); // expression - DeclOut = 0; + DeclOut = nullptr; if (ExprOut.isInvalid()) return true; @@ -1996,7 +1996,7 @@ bool Parser::ParseUnqualifiedIdTemplateId(CXXScopeSpec &SS, TemplateId->Operator = OO_None; TemplateId->TemplateNameLoc = Id.StartLocation; } else { - TemplateId->Name = 0; + TemplateId->Name = nullptr; TemplateId->Operator = Id.OperatorFunctionId.Operator; TemplateId->TemplateNameLoc = Id.StartLocation; } @@ -2201,7 +2201,7 @@ bool Parser::ParseUnqualifiedIdOperator(CXXScopeSpec &SS, bool EnteringContext, // Grab the literal operator's suffix, which will be either the next token // or a ud-suffix from the string literal. - IdentifierInfo *II = 0; + IdentifierInfo *II = nullptr; SourceLocation SuffixLoc; if (!Literal.getUDSuffix().empty()) { II = &PP.getIdentifierTable().get(Literal.getUDSuffix()); @@ -2262,8 +2262,8 @@ bool Parser::ParseUnqualifiedIdOperator(CXXScopeSpec &SS, bool EnteringContext, // Parse the conversion-declarator, which is merely a sequence of // ptr-operators. Declarator D(DS, Declarator::ConversionIdContext); - ParseDeclaratorInternal(D, /*DirectDeclParser=*/0); - + ParseDeclaratorInternal(D, /*DirectDeclParser=*/nullptr); + // Finish up the type. TypeResult Ty = Actions.ActOnTypeName(getCurScope(), D); if (Ty.isInvalid()) @@ -2419,10 +2419,10 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, bool EnteringContext, Result.getKind() == UnqualifiedId::IK_LiteralOperatorId) && (TemplateSpecified || Tok.is(tok::less))) return ParseUnqualifiedIdTemplateId(SS, TemplateKWLoc, - 0, SourceLocation(), + nullptr, SourceLocation(), EnteringContext, ObjectType, Result, TemplateSpecified); - + return false; } @@ -2861,7 +2861,7 @@ ExprResult Parser::ParseArrayTypeTrait() { switch (ATT) { case ATT_ArrayRank: { T.consumeClose(); - return Actions.ActOnArrayTypeTrait(ATT, Loc, Ty.get(), NULL, + return Actions.ActOnArrayTypeTrait(ATT, Loc, Ty.get(), nullptr, T.getCloseLocation()); } case ATT_ArrayExtent: { |