Some clang-tidy -use-modernize-nullptr

Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
hjk
2019-07-31 17:21:41 +02:00
parent 630385751a
commit 2e14df7561
180 changed files with 1312 additions and 1312 deletions

View File

@@ -44,7 +44,7 @@ ObjCSelectorAST *ObjCSelectorAST::clone(MemoryPool *pool) const
ObjCSelectorAST *ast = new (pool) ObjCSelectorAST;
for (ObjCSelectorArgumentListAST *iter = selector_argument_list, **ast_iter = &ast->selector_argument_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ObjCSelectorArgumentListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ObjCSelectorArgumentListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -75,7 +75,7 @@ GnuAttributeSpecifierAST *GnuAttributeSpecifierAST::clone(MemoryPool *pool) cons
ast->second_lparen_token = second_lparen_token;
for (GnuAttributeListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) GnuAttributeListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) GnuAttributeListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->first_rparen_token = first_rparen_token;
ast->second_rparen_token = second_rparen_token;
return ast;
@@ -89,7 +89,7 @@ GnuAttributeAST *GnuAttributeAST::clone(MemoryPool *pool) const
ast->tag_token = tag_token;
for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -121,18 +121,18 @@ DeclaratorAST *DeclaratorAST::clone(MemoryPool *pool) const
DeclaratorAST *ast = new (pool) DeclaratorAST;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
for (PtrOperatorListAST *iter = ptr_operator_list, **ast_iter = &ast->ptr_operator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) PtrOperatorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) PtrOperatorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (core_declarator)
ast->core_declarator = core_declarator->clone(pool);
for (PostfixDeclaratorListAST *iter = postfix_declarator_list, **ast_iter = &ast->postfix_declarator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) PostfixDeclaratorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) PostfixDeclaratorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
for (SpecifierListAST *iter = post_attribute_list, **ast_iter = &ast->post_attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->equal_token = equal_token;
if (initializer)
ast->initializer = initializer->clone(pool);
@@ -145,10 +145,10 @@ SimpleDeclarationAST *SimpleDeclarationAST::clone(MemoryPool *pool) const
ast->qt_invokable_token = qt_invokable_token;
for (SpecifierListAST *iter = decl_specifier_list, **ast_iter = &ast->decl_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
for (DeclaratorListAST *iter = declarator_list, **ast_iter = &ast->declarator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclaratorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclaratorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->semicolon_token = semicolon_token;
return ast;
}
@@ -187,7 +187,7 @@ QtPrivateSlotAST *QtPrivateSlotAST::clone(MemoryPool *pool) const
ast->comma_token = comma_token;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
ast->rparen_token = rparen_token;
@@ -217,7 +217,7 @@ QtPropertyDeclarationAST *QtPropertyDeclarationAST::clone(MemoryPool *pool) cons
ast->property_name = property_name->clone(pool);
for (QtPropertyDeclarationItemListAST *iter = property_declaration_item_list, **ast_iter = &ast->property_declaration_item_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) QtPropertyDeclarationItemListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) QtPropertyDeclarationItemListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -229,7 +229,7 @@ QtEnumDeclarationAST *QtEnumDeclarationAST::clone(MemoryPool *pool) const
ast->lparen_token = lparen_token;
for (NameListAST *iter = enumerator_list, **ast_iter = &ast->enumerator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -241,7 +241,7 @@ QtFlagsDeclarationAST *QtFlagsDeclarationAST::clone(MemoryPool *pool) const
ast->lparen_token = lparen_token;
for (NameListAST *iter = flag_enums_list, **ast_iter = &ast->flag_enums_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -253,7 +253,7 @@ QtInterfaceNameAST *QtInterfaceNameAST::clone(MemoryPool *pool) const
ast->interface_name = interface_name->clone(pool);
for (NameListAST *iter = constraint_list, **ast_iter = &ast->constraint_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -264,7 +264,7 @@ QtInterfacesDeclarationAST *QtInterfacesDeclarationAST::clone(MemoryPool *pool)
ast->lparen_token = lparen_token;
for (QtInterfaceNameListAST *iter = interface_name_list, **ast_iter = &ast->interface_name_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) QtInterfaceNameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) QtInterfaceNameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -372,19 +372,19 @@ ClassSpecifierAST *ClassSpecifierAST::clone(MemoryPool *pool) const
ast->classkey_token = classkey_token;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (name)
ast->name = name->clone(pool);
ast->final_token = final_token;
ast->colon_token = colon_token;
for (BaseSpecifierListAST *iter = base_clause_list, **ast_iter = &ast->base_clause_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) BaseSpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) BaseSpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->dot_dot_dot_token = dot_dot_dot_token;
ast->lbrace_token = lbrace_token;
for (DeclarationListAST *iter = member_specifier_list, **ast_iter = &ast->member_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rbrace_token = rbrace_token;
return ast;
}
@@ -407,7 +407,7 @@ CompoundStatementAST *CompoundStatementAST::clone(MemoryPool *pool) const
ast->lbrace_token = lbrace_token;
for (StatementListAST *iter = statement_list, **ast_iter = &ast->statement_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) StatementListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) StatementListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rbrace_token = rbrace_token;
return ast;
}
@@ -417,7 +417,7 @@ ConditionAST *ConditionAST::clone(MemoryPool *pool) const
ConditionAST *ast = new (pool) ConditionAST;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
return ast;
@@ -458,7 +458,7 @@ CtorInitializerAST *CtorInitializerAST::clone(MemoryPool *pool) const
ast->colon_token = colon_token;
for (MemInitializerListAST *iter = member_initializer_list, **ast_iter = &ast->member_initializer_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) MemInitializerListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) MemInitializerListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->dot_dot_dot_token = dot_dot_dot_token;
return ast;
}
@@ -499,7 +499,7 @@ FunctionDeclaratorAST *FunctionDeclaratorAST::clone(MemoryPool *pool) const
ast->rparen_token = rparen_token;
for (SpecifierListAST *iter = cv_qualifier_list, **ast_iter = &ast->cv_qualifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->ref_qualifier_token = ref_qualifier_token;
if (exception_specification)
ast->exception_specification = exception_specification->clone(pool);
@@ -561,7 +561,7 @@ ElaboratedTypeSpecifierAST *ElaboratedTypeSpecifierAST::clone(MemoryPool *pool)
ast->classkey_token = classkey_token;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (name)
ast->name = name->clone(pool);
return ast;
@@ -577,11 +577,11 @@ EnumSpecifierAST *EnumSpecifierAST::clone(MemoryPool *pool) const
ast->colon_token = colon_token;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->lbrace_token = lbrace_token;
for (EnumeratorListAST *iter = enumerator_list, **ast_iter = &ast->enumerator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) EnumeratorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) EnumeratorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->stray_comma_token = stray_comma_token;
ast->rbrace_token = rbrace_token;
return ast;
@@ -602,7 +602,7 @@ ExceptionDeclarationAST *ExceptionDeclarationAST::clone(MemoryPool *pool) const
ExceptionDeclarationAST *ast = new (pool) ExceptionDeclarationAST;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
ast->dot_dot_dot_token = dot_dot_dot_token;
@@ -617,7 +617,7 @@ DynamicExceptionSpecificationAST *DynamicExceptionSpecificationAST::clone(Memory
ast->dot_dot_dot_token = dot_dot_dot_token;
for (ExpressionListAST *iter = type_id_list, **ast_iter = &ast->type_id_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -658,7 +658,7 @@ FunctionDefinitionAST *FunctionDefinitionAST::clone(MemoryPool *pool) const
ast->qt_invokable_token = qt_invokable_token;
for (SpecifierListAST *iter = decl_specifier_list, **ast_iter = &ast->decl_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
if (ctor_initializer)
@@ -675,7 +675,7 @@ ForeachStatementAST *ForeachStatementAST::clone(MemoryPool *pool) const
ast->lparen_token = lparen_token;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
if (initializer)
@@ -696,7 +696,7 @@ RangeBasedForStatementAST *RangeBasedForStatementAST::clone(MemoryPool *pool) co
ast->lparen_token = lparen_token;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
ast->colon_token = colon_token;
@@ -748,7 +748,7 @@ ArrayInitializerAST *ArrayInitializerAST::clone(MemoryPool *pool) const
ast->lbrace_token = lbrace_token;
for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rbrace_token = rbrace_token;
return ast;
}
@@ -769,7 +769,7 @@ LinkageBodyAST *LinkageBodyAST::clone(MemoryPool *pool) const
ast->lbrace_token = lbrace_token;
for (DeclarationListAST *iter = declaration_list, **ast_iter = &ast->declaration_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rbrace_token = rbrace_token;
return ast;
}
@@ -809,7 +809,7 @@ QualifiedNameAST *QualifiedNameAST::clone(MemoryPool *pool) const
ast->global_scope_token = global_scope_token;
for (NestedNameSpecifierListAST *iter = nested_name_specifier_list, **ast_iter = &ast->nested_name_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NestedNameSpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NestedNameSpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (unqualified_name)
ast->unqualified_name = unqualified_name->clone(pool);
return ast;
@@ -830,10 +830,10 @@ ConversionFunctionIdAST *ConversionFunctionIdAST::clone(MemoryPool *pool) const
ast->operator_token = operator_token;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
for (PtrOperatorListAST *iter = ptr_operator_list, **ast_iter = &ast->ptr_operator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) PtrOperatorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) PtrOperatorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -868,7 +868,7 @@ TemplateIdAST *TemplateIdAST::clone(MemoryPool *pool) const
ast->less_token = less_token;
for (ExpressionListAST *iter = template_argument_list, **ast_iter = &ast->template_argument_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->greater_token = greater_token;
return ast;
}
@@ -881,7 +881,7 @@ NamespaceAST *NamespaceAST::clone(MemoryPool *pool) const
ast->identifier_token = identifier_token;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (linkage_body)
ast->linkage_body = linkage_body->clone(pool);
return ast;
@@ -918,7 +918,7 @@ ExpressionListParenAST *ExpressionListParenAST::clone(MemoryPool *pool) const
ast->lparen_token = lparen_token;
for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -956,13 +956,13 @@ NewTypeIdAST *NewTypeIdAST::clone(MemoryPool *pool) const
NewTypeIdAST *ast = new (pool) NewTypeIdAST;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
for (PtrOperatorListAST *iter = ptr_operator_list, **ast_iter = &ast->ptr_operator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) PtrOperatorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) PtrOperatorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
for (NewArrayDeclaratorListAST *iter = new_array_declarator_list, **ast_iter = &ast->new_array_declarator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NewArrayDeclaratorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NewArrayDeclaratorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -980,7 +980,7 @@ ParameterDeclarationAST *ParameterDeclarationAST::clone(MemoryPool *pool) const
ParameterDeclarationAST *ast = new (pool) ParameterDeclarationAST;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
ast->equal_token = equal_token;
@@ -994,7 +994,7 @@ ParameterDeclarationClauseAST *ParameterDeclarationClauseAST::clone(MemoryPool *
ParameterDeclarationClauseAST *ast = new (pool) ParameterDeclarationClauseAST;
for (ParameterDeclarationListAST *iter = parameter_declaration_list, **ast_iter = &ast->parameter_declaration_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ParameterDeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ParameterDeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->dot_dot_dot_token = dot_dot_dot_token;
return ast;
}
@@ -1007,7 +1007,7 @@ CallAST *CallAST::clone(MemoryPool *pool) const
ast->lparen_token = lparen_token;
for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
return ast;
}
@@ -1072,7 +1072,7 @@ TypeConstructorCallAST *TypeConstructorCallAST::clone(MemoryPool *pool) const
TypeConstructorCallAST *ast = new (pool) TypeConstructorCallAST;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (expression)
ast->expression = expression->clone(pool);
return ast;
@@ -1084,11 +1084,11 @@ PointerToMemberAST *PointerToMemberAST::clone(MemoryPool *pool) const
ast->global_scope_token = global_scope_token;
for (NestedNameSpecifierListAST *iter = nested_name_specifier_list, **ast_iter = &ast->nested_name_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NestedNameSpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NestedNameSpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->star_token = star_token;
for (SpecifierListAST *iter = cv_qualifier_list, **ast_iter = &ast->cv_qualifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->ref_qualifier_token = ref_qualifier_token;
return ast;
}
@@ -1099,7 +1099,7 @@ PointerAST *PointerAST::clone(MemoryPool *pool) const
ast->star_token = star_token;
for (SpecifierListAST *iter = cv_qualifier_list, **ast_iter = &ast->cv_qualifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -1251,7 +1251,7 @@ TemplateDeclarationAST *TemplateDeclarationAST::clone(MemoryPool *pool) const
ast->less_token = less_token;
for (DeclarationListAST *iter = template_parameter_list, **ast_iter = &ast->template_parameter_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->greater_token = greater_token;
if (declaration)
ast->declaration = declaration->clone(pool);
@@ -1281,7 +1281,7 @@ TranslationUnitAST *TranslationUnitAST::clone(MemoryPool *pool) const
TranslationUnitAST *ast = new (pool) TranslationUnitAST;
for (DeclarationListAST *iter = declaration_list, **ast_iter = &ast->declaration_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -1293,7 +1293,7 @@ TryBlockStatementAST *TryBlockStatementAST::clone(MemoryPool *pool) const
ast->statement = statement->clone(pool);
for (CatchClauseListAST *iter = catch_clause_list, **ast_iter = &ast->catch_clause_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) CatchClauseListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) CatchClauseListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -1315,7 +1315,7 @@ TypeIdAST *TypeIdAST::clone(MemoryPool *pool) const
TypeIdAST *ast = new (pool) TypeIdAST;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
return ast;
@@ -1341,7 +1341,7 @@ TemplateTypeParameterAST *TemplateTypeParameterAST::clone(MemoryPool *pool) cons
ast->less_token = less_token;
for (DeclarationListAST *iter = template_parameter_list, **ast_iter = &ast->template_parameter_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->greater_token = greater_token;
ast->class_token = class_token;
ast->dot_dot_dot_token = dot_dot_dot_token;
@@ -1402,11 +1402,11 @@ ObjCClassForwardDeclarationAST *ObjCClassForwardDeclarationAST::clone(MemoryPool
ObjCClassForwardDeclarationAST *ast = new (pool) ObjCClassForwardDeclarationAST;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->class_token = class_token;
for (NameListAST *iter = identifier_list, **ast_iter = &ast->identifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->semicolon_token = semicolon_token;
return ast;
}
@@ -1416,7 +1416,7 @@ ObjCClassDeclarationAST *ObjCClassDeclarationAST::clone(MemoryPool *pool) const
ObjCClassDeclarationAST *ast = new (pool) ObjCClassDeclarationAST;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->interface_token = interface_token;
ast->implementation_token = implementation_token;
if (class_name)
@@ -1434,7 +1434,7 @@ ObjCClassDeclarationAST *ObjCClassDeclarationAST::clone(MemoryPool *pool) const
ast->inst_vars_decl = inst_vars_decl->clone(pool);
for (DeclarationListAST *iter = member_declaration_list, **ast_iter = &ast->member_declaration_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->end_token = end_token;
return ast;
}
@@ -1444,11 +1444,11 @@ ObjCProtocolForwardDeclarationAST *ObjCProtocolForwardDeclarationAST::clone(Memo
ObjCProtocolForwardDeclarationAST *ast = new (pool) ObjCProtocolForwardDeclarationAST;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->protocol_token = protocol_token;
for (NameListAST *iter = identifier_list, **ast_iter = &ast->identifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->semicolon_token = semicolon_token;
return ast;
}
@@ -1458,7 +1458,7 @@ ObjCProtocolDeclarationAST *ObjCProtocolDeclarationAST::clone(MemoryPool *pool)
ObjCProtocolDeclarationAST *ast = new (pool) ObjCProtocolDeclarationAST;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->protocol_token = protocol_token;
if (name)
ast->name = name->clone(pool);
@@ -1466,7 +1466,7 @@ ObjCProtocolDeclarationAST *ObjCProtocolDeclarationAST::clone(MemoryPool *pool)
ast->protocol_refs = protocol_refs->clone(pool);
for (DeclarationListAST *iter = member_declaration_list, **ast_iter = &ast->member_declaration_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->end_token = end_token;
return ast;
}
@@ -1477,7 +1477,7 @@ ObjCProtocolRefsAST *ObjCProtocolRefsAST::clone(MemoryPool *pool) const
ast->less_token = less_token;
for (NameListAST *iter = identifier_list, **ast_iter = &ast->identifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->greater_token = greater_token;
return ast;
}
@@ -1500,7 +1500,7 @@ ObjCMessageExpressionAST *ObjCMessageExpressionAST::clone(MemoryPool *pool) cons
ast->selector = selector->clone(pool);
for (ObjCMessageArgumentListAST *iter = argument_list, **ast_iter = &ast->argument_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ObjCMessageArgumentListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ObjCMessageArgumentListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rbracket_token = rbracket_token;
return ast;
}
@@ -1552,7 +1552,7 @@ ObjCInstanceVariablesDeclarationAST *ObjCInstanceVariablesDeclarationAST::clone(
ast->lbrace_token = lbrace_token;
for (DeclarationListAST *iter = instance_variable_list, **ast_iter = &ast->instance_variable_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rbrace_token = rbrace_token;
return ast;
}
@@ -1579,12 +1579,12 @@ ObjCPropertyDeclarationAST *ObjCPropertyDeclarationAST::clone(MemoryPool *pool)
ObjCPropertyDeclarationAST *ast = new (pool) ObjCPropertyDeclarationAST;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->property_token = property_token;
ast->lparen_token = lparen_token;
for (ObjCPropertyAttributeListAST *iter = property_attribute_list, **ast_iter = &ast->property_attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ObjCPropertyAttributeListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ObjCPropertyAttributeListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->rparen_token = rparen_token;
if (simple_declaration)
ast->simple_declaration = simple_declaration->clone(pool);
@@ -1598,7 +1598,7 @@ ObjCMessageArgumentDeclarationAST *ObjCMessageArgumentDeclarationAST::clone(Memo
ast->type_name = type_name->clone(pool);
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (param_name)
ast->param_name = param_name->clone(pool);
return ast;
@@ -1614,11 +1614,11 @@ ObjCMethodPrototypeAST *ObjCMethodPrototypeAST::clone(MemoryPool *pool) const
ast->selector = selector->clone(pool);
for (ObjCMessageArgumentDeclarationListAST *iter = argument_list, **ast_iter = &ast->argument_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ObjCMessageArgumentDeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ObjCMessageArgumentDeclarationListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->dot_dot_dot_token = dot_dot_dot_token;
for (SpecifierListAST *iter = attribute_list, **ast_iter = &ast->attribute_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -1648,7 +1648,7 @@ ObjCSynthesizedPropertiesDeclarationAST *ObjCSynthesizedPropertiesDeclarationAST
ast->synthesized_token = synthesized_token;
for (ObjCSynthesizedPropertyListAST *iter = property_identifier_list, **ast_iter = &ast->property_identifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ObjCSynthesizedPropertyListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ObjCSynthesizedPropertyListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->semicolon_token = semicolon_token;
return ast;
}
@@ -1659,7 +1659,7 @@ ObjCDynamicPropertiesDeclarationAST *ObjCDynamicPropertiesDeclarationAST::clone(
ast->dynamic_token = dynamic_token;
for (NameListAST *iter = property_identifier_list, **ast_iter = &ast->property_identifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) NameListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->semicolon_token = semicolon_token;
return ast;
}
@@ -1671,7 +1671,7 @@ ObjCFastEnumerationAST *ObjCFastEnumerationAST::clone(MemoryPool *pool) const
ast->lparen_token = lparen_token;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
if (initializer)
@@ -1726,7 +1726,7 @@ LambdaCaptureAST *LambdaCaptureAST::clone(MemoryPool *pool) const
ast->default_capture_token = default_capture_token;
for (CaptureListAST *iter = capture_list, **ast_iter = &ast->capture_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) CaptureListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) CaptureListAST((iter->value) ? iter->value->clone(pool) : nullptr);
return ast;
}
@@ -1748,7 +1748,7 @@ LambdaDeclaratorAST *LambdaDeclaratorAST::clone(MemoryPool *pool) const
ast->rparen_token = rparen_token;
for (SpecifierListAST *iter = attributes, **ast_iter = &ast->attributes;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->mutable_token = mutable_token;
if (exception_specification)
ast->exception_specification = exception_specification->clone(pool);
@@ -1763,10 +1763,10 @@ TrailingReturnTypeAST *TrailingReturnTypeAST::clone(MemoryPool *pool) const
ast->arrow_token = arrow_token;
for (SpecifierListAST *iter = attributes, **ast_iter = &ast->attributes;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : nullptr);
if (declarator)
ast->declarator = declarator->clone(pool);
return ast;
@@ -1778,7 +1778,7 @@ BracedInitializerAST *BracedInitializerAST::clone(MemoryPool *pool) const
ast->lbrace_token = lbrace_token;
for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ExpressionListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->comma_token = comma_token;
ast->rbrace_token = rbrace_token;
return ast;
@@ -1807,7 +1807,7 @@ DesignatedInitializerAST *DesignatedInitializerAST::clone(MemoryPool *pool) cons
DesignatedInitializerAST *ast = new (pool) DesignatedInitializerAST;
for (DesignatorListAST *iter = designator_list, **ast_iter = &ast->designator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DesignatorListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) DesignatorListAST((iter->value) ? iter->value->clone(pool) : nullptr);
ast->equal_token = equal_token;
if (initializer)
ast->initializer = initializer->clone(pool);

View File

@@ -1181,7 +1181,7 @@ public:
return ast;
}
BaseSpecifierListAST *BaseSpecifierList(BaseSpecifierAST *value, BaseSpecifierListAST *next = 0)
BaseSpecifierListAST *BaseSpecifierList(BaseSpecifierAST *value, BaseSpecifierListAST *next = nullptr)
{
BaseSpecifierListAST *list = new (&pool) BaseSpecifierListAST;
list->next = next;
@@ -1189,7 +1189,7 @@ public:
return list;
}
CaptureListAST *CaptureList(CaptureAST *value, CaptureListAST *next = 0)
CaptureListAST *CaptureList(CaptureAST *value, CaptureListAST *next = nullptr)
{
CaptureListAST *list = new (&pool) CaptureListAST;
list->next = next;
@@ -1197,7 +1197,7 @@ public:
return list;
}
CatchClauseListAST *CatchClauseList(CatchClauseAST *value, CatchClauseListAST *next = 0)
CatchClauseListAST *CatchClauseList(CatchClauseAST *value, CatchClauseListAST *next = nullptr)
{
CatchClauseListAST *list = new (&pool) CatchClauseListAST;
list->next = next;
@@ -1205,7 +1205,7 @@ public:
return list;
}
DeclarationListAST *DeclarationList(DeclarationAST *value, DeclarationListAST *next = 0)
DeclarationListAST *DeclarationList(DeclarationAST *value, DeclarationListAST *next = nullptr)
{
DeclarationListAST *list = new (&pool) DeclarationListAST;
list->next = next;
@@ -1213,7 +1213,7 @@ public:
return list;
}
DeclaratorListAST *DeclaratorList(DeclaratorAST *value, DeclaratorListAST *next = 0)
DeclaratorListAST *DeclaratorList(DeclaratorAST *value, DeclaratorListAST *next = nullptr)
{
DeclaratorListAST *list = new (&pool) DeclaratorListAST;
list->next = next;
@@ -1221,7 +1221,7 @@ public:
return list;
}
DesignatorListAST *DesignatorList(DesignatorAST *value, DesignatorListAST *next = 0)
DesignatorListAST *DesignatorList(DesignatorAST *value, DesignatorListAST *next = nullptr)
{
DesignatorListAST *list = new (&pool) DesignatorListAST;
list->next = next;
@@ -1229,7 +1229,7 @@ public:
return list;
}
EnumeratorListAST *EnumeratorList(EnumeratorAST *value, EnumeratorListAST *next = 0)
EnumeratorListAST *EnumeratorList(EnumeratorAST *value, EnumeratorListAST *next = nullptr)
{
EnumeratorListAST *list = new (&pool) EnumeratorListAST;
list->next = next;
@@ -1237,7 +1237,7 @@ public:
return list;
}
ExpressionListAST *ExpressionList(ExpressionAST *value, ExpressionListAST *next = 0)
ExpressionListAST *ExpressionList(ExpressionAST *value, ExpressionListAST *next = nullptr)
{
ExpressionListAST *list = new (&pool) ExpressionListAST;
list->next = next;
@@ -1245,7 +1245,7 @@ public:
return list;
}
GnuAttributeListAST *GnuAttributeList(GnuAttributeAST *value, GnuAttributeListAST *next = 0)
GnuAttributeListAST *GnuAttributeList(GnuAttributeAST *value, GnuAttributeListAST *next = nullptr)
{
GnuAttributeListAST *list = new (&pool) GnuAttributeListAST;
list->next = next;
@@ -1253,7 +1253,7 @@ public:
return list;
}
MemInitializerListAST *MemInitializerList(MemInitializerAST *value, MemInitializerListAST *next = 0)
MemInitializerListAST *MemInitializerList(MemInitializerAST *value, MemInitializerListAST *next = nullptr)
{
MemInitializerListAST *list = new (&pool) MemInitializerListAST;
list->next = next;
@@ -1261,7 +1261,7 @@ public:
return list;
}
NameListAST *NameList(NameAST *value, NameListAST *next = 0)
NameListAST *NameList(NameAST *value, NameListAST *next = nullptr)
{
NameListAST *list = new (&pool) NameListAST;
list->next = next;
@@ -1269,7 +1269,7 @@ public:
return list;
}
NestedNameSpecifierListAST *NestedNameSpecifierList(NestedNameSpecifierAST *value, NestedNameSpecifierListAST *next = 0)
NestedNameSpecifierListAST *NestedNameSpecifierList(NestedNameSpecifierAST *value, NestedNameSpecifierListAST *next = nullptr)
{
NestedNameSpecifierListAST *list = new (&pool) NestedNameSpecifierListAST;
list->next = next;
@@ -1277,7 +1277,7 @@ public:
return list;
}
NewArrayDeclaratorListAST *NewArrayDeclaratorList(NewArrayDeclaratorAST *value, NewArrayDeclaratorListAST *next = 0)
NewArrayDeclaratorListAST *NewArrayDeclaratorList(NewArrayDeclaratorAST *value, NewArrayDeclaratorListAST *next = nullptr)
{
NewArrayDeclaratorListAST *list = new (&pool) NewArrayDeclaratorListAST;
list->next = next;
@@ -1285,7 +1285,7 @@ public:
return list;
}
ObjCMessageArgumentDeclarationListAST *ObjCMessageArgumentDeclarationList(ObjCMessageArgumentDeclarationAST *value, ObjCMessageArgumentDeclarationListAST *next = 0)
ObjCMessageArgumentDeclarationListAST *ObjCMessageArgumentDeclarationList(ObjCMessageArgumentDeclarationAST *value, ObjCMessageArgumentDeclarationListAST *next = nullptr)
{
ObjCMessageArgumentDeclarationListAST *list = new (&pool) ObjCMessageArgumentDeclarationListAST;
list->next = next;
@@ -1293,7 +1293,7 @@ public:
return list;
}
ObjCMessageArgumentListAST *ObjCMessageArgumentList(ObjCMessageArgumentAST *value, ObjCMessageArgumentListAST *next = 0)
ObjCMessageArgumentListAST *ObjCMessageArgumentList(ObjCMessageArgumentAST *value, ObjCMessageArgumentListAST *next = nullptr)
{
ObjCMessageArgumentListAST *list = new (&pool) ObjCMessageArgumentListAST;
list->next = next;
@@ -1301,7 +1301,7 @@ public:
return list;
}
ObjCPropertyAttributeListAST *ObjCPropertyAttributeList(ObjCPropertyAttributeAST *value, ObjCPropertyAttributeListAST *next = 0)
ObjCPropertyAttributeListAST *ObjCPropertyAttributeList(ObjCPropertyAttributeAST *value, ObjCPropertyAttributeListAST *next = nullptr)
{
ObjCPropertyAttributeListAST *list = new (&pool) ObjCPropertyAttributeListAST;
list->next = next;
@@ -1309,7 +1309,7 @@ public:
return list;
}
ObjCSelectorArgumentListAST *ObjCSelectorArgumentList(ObjCSelectorArgumentAST *value, ObjCSelectorArgumentListAST *next = 0)
ObjCSelectorArgumentListAST *ObjCSelectorArgumentList(ObjCSelectorArgumentAST *value, ObjCSelectorArgumentListAST *next = nullptr)
{
ObjCSelectorArgumentListAST *list = new (&pool) ObjCSelectorArgumentListAST;
list->next = next;
@@ -1317,7 +1317,7 @@ public:
return list;
}
ObjCSynthesizedPropertyListAST *ObjCSynthesizedPropertyList(ObjCSynthesizedPropertyAST *value, ObjCSynthesizedPropertyListAST *next = 0)
ObjCSynthesizedPropertyListAST *ObjCSynthesizedPropertyList(ObjCSynthesizedPropertyAST *value, ObjCSynthesizedPropertyListAST *next = nullptr)
{
ObjCSynthesizedPropertyListAST *list = new (&pool) ObjCSynthesizedPropertyListAST;
list->next = next;
@@ -1325,7 +1325,7 @@ public:
return list;
}
ParameterDeclarationListAST *ParameterDeclarationList(ParameterDeclarationAST *value, ParameterDeclarationListAST *next = 0)
ParameterDeclarationListAST *ParameterDeclarationList(ParameterDeclarationAST *value, ParameterDeclarationListAST *next = nullptr)
{
ParameterDeclarationListAST *list = new (&pool) ParameterDeclarationListAST;
list->next = next;
@@ -1333,7 +1333,7 @@ public:
return list;
}
PostfixDeclaratorListAST *PostfixDeclaratorList(PostfixDeclaratorAST *value, PostfixDeclaratorListAST *next = 0)
PostfixDeclaratorListAST *PostfixDeclaratorList(PostfixDeclaratorAST *value, PostfixDeclaratorListAST *next = nullptr)
{
PostfixDeclaratorListAST *list = new (&pool) PostfixDeclaratorListAST;
list->next = next;
@@ -1341,7 +1341,7 @@ public:
return list;
}
PtrOperatorListAST *PtrOperatorList(PtrOperatorAST *value, PtrOperatorListAST *next = 0)
PtrOperatorListAST *PtrOperatorList(PtrOperatorAST *value, PtrOperatorListAST *next = nullptr)
{
PtrOperatorListAST *list = new (&pool) PtrOperatorListAST;
list->next = next;
@@ -1349,7 +1349,7 @@ public:
return list;
}
QtInterfaceNameListAST *QtInterfaceNameList(QtInterfaceNameAST *value, QtInterfaceNameListAST *next = 0)
QtInterfaceNameListAST *QtInterfaceNameList(QtInterfaceNameAST *value, QtInterfaceNameListAST *next = nullptr)
{
QtInterfaceNameListAST *list = new (&pool) QtInterfaceNameListAST;
list->next = next;
@@ -1357,7 +1357,7 @@ public:
return list;
}
QtPropertyDeclarationItemListAST *QtPropertyDeclarationItemList(QtPropertyDeclarationItemAST *value, QtPropertyDeclarationItemListAST *next = 0)
QtPropertyDeclarationItemListAST *QtPropertyDeclarationItemList(QtPropertyDeclarationItemAST *value, QtPropertyDeclarationItemListAST *next = nullptr)
{
QtPropertyDeclarationItemListAST *list = new (&pool) QtPropertyDeclarationItemListAST;
list->next = next;
@@ -1365,7 +1365,7 @@ public:
return list;
}
SpecifierListAST *SpecifierList(SpecifierAST *value, SpecifierListAST *next = 0)
SpecifierListAST *SpecifierList(SpecifierAST *value, SpecifierListAST *next = nullptr)
{
SpecifierListAST *list = new (&pool) SpecifierListAST;
list->next = next;
@@ -1373,7 +1373,7 @@ public:
return list;
}
StatementListAST *StatementList(StatementAST *value, StatementListAST *next = 0)
StatementListAST *StatementList(StatementAST *value, StatementListAST *next = nullptr)
{
StatementListAST *list = new (&pool) StatementListAST;
list->next = next;

View File

@@ -40,7 +40,7 @@ Control *ASTVisitor::control() const
if (_translationUnit)
return _translationUnit->control();
return 0;
return nullptr;
}
TranslationUnit *ASTVisitor::translationUnit() const

View File

@@ -42,10 +42,10 @@ const int Bind::kMaxDepth(100);
Bind::Bind(TranslationUnit *unit)
: ASTVisitor(unit),
_scope(0),
_expression(0),
_name(0),
_declaratorId(0),
_scope(nullptr),
_expression(nullptr),
_name(nullptr),
_declaratorId(nullptr),
_visibility(Symbol::Public),
_objcVisibility(Symbol::Public),
_methodKey(Function::NormalMethod),
@@ -229,7 +229,7 @@ void Bind::declaration(DeclarationAST *ast)
const Name *Bind::name(NameAST *ast)
{
const Name *value = 0;
const Name *value = nullptr;
std::swap(_name, value);
accept(ast);
std::swap(_name, value);
@@ -296,7 +296,7 @@ bool Bind::visit(ObjCSelectorArgumentAST *ast)
const Name *Bind::objCSelectorArgument(ObjCSelectorArgumentAST *ast, bool *hasArg)
{
if (! (ast && ast->name_token))
return 0;
return nullptr;
if (ast->colon_token)
*hasArg = true;
@@ -531,7 +531,7 @@ const StringLiteral *valueOfEnumerator(const Enum *e, const Identifier *value) {
}
}
}
return 0;
return nullptr;
}
} // anonymous namespace
@@ -556,7 +556,7 @@ void Bind::enumerator(EnumeratorAST *ast, Enum *symbol)
const int firstToken = expr->firstToken();
const int lastToken = expr->lastToken();
const StringLiteral *constantValue = asStringLiteral(expr);
const StringLiteral *resolvedValue = 0;
const StringLiteral *resolvedValue = nullptr;
if (lastToken - firstToken == 1) {
if (const Identifier *constantId = identifier(firstToken))
resolvedValue = valueOfEnumerator(symbol, constantId);
@@ -629,7 +629,7 @@ bool Bind::visit(NestedNameSpecifierAST *ast)
const Name *Bind::nestedNameSpecifier(NestedNameSpecifierAST *ast)
{
if (! ast)
return 0;
return nullptr;
const Name *class_or_namespace_name = this->name(ast->class_or_namespace_name);
return class_or_namespace_name;
@@ -1070,7 +1070,7 @@ bool Bind::visit(ObjCMethodPrototypeAST *ast)
ObjCMethod *Bind::objCMethodPrototype(ObjCMethodPrototypeAST *ast)
{
if (! ast)
return 0;
return nullptr;
// int method_type_token = ast->method_type_token;
FullySpecifiedType returnType = this->objCTypeName(ast->type_name);
@@ -1180,9 +1180,9 @@ bool Bind::visit(LambdaDeclaratorAST *ast)
Function *Bind::lambdaDeclarator(LambdaDeclaratorAST *ast)
{
if (! ast)
return 0;
return nullptr;
Function *fun = control()->newFunction(0, 0);
Function *fun = control()->newFunction(0, nullptr);
fun->setStartOffset(tokenAt(ast->firstToken()).utf16charsBegin());
fun->setEndOffset(tokenAt(ast->lastToken() - 1).utf16charsEnd());
@@ -1227,14 +1227,14 @@ FullySpecifiedType Bind::trailingReturnType(TrailingReturnTypeAST *ast, const Fu
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
return type;
}
const StringLiteral *Bind::asStringLiteral(const ExpressionAST *ast)
{
CPP_ASSERT(ast, return 0);
CPP_ASSERT(ast, return nullptr);
const int firstToken = ast->firstToken();
const int lastToken = ast->lastToken();
std::string buffer;
@@ -1250,7 +1250,7 @@ const StringLiteral *Bind::asStringLiteral(const ExpressionAST *ast)
// StatementAST
bool Bind::visit(QtMemberDeclarationAST *ast)
{
const Name *name = 0;
const Name *name = nullptr;
if (tokenKind(ast->q_token) == T_Q_D)
name = control()->identifier("d");
@@ -1344,18 +1344,18 @@ bool Bind::visit(ForeachStatementAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
const StringLiteral *initializer = 0;
const StringLiteral *initializer = nullptr;
if (type.isAuto() && translationUnit()->languageFeatures().cxx11Enabled) {
ExpressionTy exprType = this->expression(ast->expression);
ArrayType* arrayType = 0;
ArrayType* arrayType = nullptr;
arrayType = exprType->asArrayType();
if (arrayType != 0)
if (arrayType != nullptr)
type = arrayType->elementType();
else if (ast->expression != 0) {
else if (ast->expression != nullptr) {
const StringLiteral *sl = asStringLiteral(ast->expression);
const std::string buff = std::string("*") + sl->chars() + ".begin()";
initializer = control()->stringLiteral(buff.c_str(), int(buff.size()));
@@ -1392,18 +1392,18 @@ bool Bind::visit(RangeBasedForStatementAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
const StringLiteral *initializer = 0;
const StringLiteral *initializer = nullptr;
if (type.isAuto() && translationUnit()->languageFeatures().cxx11Enabled) {
ExpressionTy exprType = this->expression(ast->expression);
ArrayType* arrayType = 0;
ArrayType* arrayType = nullptr;
arrayType = exprType->asArrayType();
if (arrayType != 0)
if (arrayType != nullptr)
type = arrayType->elementType();
else if (ast->expression != 0) {
else if (ast->expression != nullptr) {
const StringLiteral *sl = asStringLiteral(ast->expression);
const std::string buff = std::string("*") + sl->chars() + ".begin()";
initializer = control()->stringLiteral(buff.c_str(), int(buff.size()));
@@ -1573,7 +1573,7 @@ bool Bind::visit(ObjCFastEnumerationAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
if (declaratorId && declaratorId->name) {
@@ -1630,7 +1630,7 @@ bool Bind::visit(QtMethodAST *ast)
// int method_token = ast->method_token;
// int lparen_token = ast->lparen_token;
FullySpecifiedType type;
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
// int rparen_token = ast->rparen_token;
return false;
@@ -1659,7 +1659,7 @@ bool Bind::visit(ConditionAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
if (declaratorId && declaratorId->name) {
@@ -1824,7 +1824,7 @@ bool Bind::visit(TypeIdAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
_expression = type;
return false;
@@ -1929,13 +1929,13 @@ bool Bind::visit(SimpleDeclarationAST *ast)
List<Symbol *> **symbolTail = &ast->symbols;
if (! ast->declarator_list) {
ElaboratedTypeSpecifierAST *elabTypeSpec = 0;
ElaboratedTypeSpecifierAST *elabTypeSpec = nullptr;
for (SpecifierListAST *it = ast->decl_specifier_list; ! elabTypeSpec && it; it = it->next)
elabTypeSpec = it->value->asElaboratedTypeSpecifier();
if (elabTypeSpec && tokenKind(elabTypeSpec->classkey_token) != T_TYPENAME) {
int sourceLocation = elabTypeSpec->firstToken();
const Name *name = 0;
const Name *name = nullptr;
if (elabTypeSpec->name) {
sourceLocation = location(elabTypeSpec->name, sourceLocation);
name = elabTypeSpec->name->name;
@@ -1953,10 +1953,10 @@ bool Bind::visit(SimpleDeclarationAST *ast)
}
for (DeclaratorListAST *it = ast->declarator_list; it; it = it->next) {
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
FullySpecifiedType declTy = this->declarator(it->value, type, &declaratorId);
const Name *declName = 0;
const Name *declName = nullptr;
int sourceLocation = location(it->value, ast->firstToken());
if (declaratorId && declaratorId->name)
declName = declaratorId->name->name;
@@ -2050,7 +2050,7 @@ bool Bind::visit(QtPrivateSlotAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
// int rparen_token = ast->rparen_token;
return false;
@@ -2208,10 +2208,10 @@ bool Bind::visit(ExceptionDeclarationAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
const Name *argName = 0;
const Name *argName = nullptr;
if (declaratorId && declaratorId->name)
argName = declaratorId->name->name;
Argument *arg = control()->newArgument(location(declaratorId, ast->firstToken()), argName);
@@ -2233,7 +2233,7 @@ bool Bind::visit(FunctionDefinitionAST *ast)
for (SpecifierListAST *it = ast->decl_specifier_list; it; it = it->next) {
declSpecifiers = this->specifier(it->value, declSpecifiers);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
FullySpecifiedType type = this->declarator(ast->declarator, declSpecifiers.qualifiedType(), &declaratorId);
Function *fun = type->asFunctionType();
@@ -2296,7 +2296,7 @@ bool Bind::visit(NamespaceAST *ast)
}
int sourceLocation = ast->firstToken();
const Name *namespaceName = 0;
const Name *namespaceName = nullptr;
if (ast->identifier_token) {
sourceLocation = ast->identifier_token;
namespaceName = identifier(ast->identifier_token);
@@ -2318,7 +2318,7 @@ bool Bind::visit(NamespaceAST *ast)
bool Bind::visit(NamespaceAliasDefinitionAST *ast)
{
int sourceLocation = ast->firstToken();
const Name *name = 0;
const Name *name = nullptr;
if (ast->namespace_name_token) {
sourceLocation = ast->namespace_name_token;
name = identifier(ast->namespace_name_token);
@@ -2336,12 +2336,12 @@ bool Bind::visit(ParameterDeclarationAST *ast)
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
DeclaratorIdAST *declaratorId = nullptr;
type = this->declarator(ast->declarator, type, &declaratorId);
// int equal_token = ast->equal_token;
ExpressionTy expression = this->expression(ast->expression);
const Name *argName = 0;
const Name *argName = nullptr;
if (declaratorId && declaratorId->name)
argName = declaratorId->name->name;
@@ -2359,7 +2359,7 @@ bool Bind::visit(ParameterDeclarationAST *ast)
bool Bind::visit(TemplateDeclarationAST *ast)
{
Template *templ = control()->newTemplate(ast->firstToken(), 0);
Template *templ = control()->newTemplate(ast->firstToken(), nullptr);
templ->setStartOffset(tokenAt(ast->firstToken()).utf16charsBegin());
templ->setEndOffset(tokenAt(ast->lastToken() - 1).utf16charsEnd());
ast->symbol = templ;
@@ -3136,7 +3136,7 @@ bool Bind::visit(EnumSpecifierAST *ast)
// PtrOperatorAST
bool Bind::visit(PointerToMemberAST *ast)
{
const Name *memberName = 0;
const Name *memberName = nullptr;
for (NestedNameSpecifierListAST *it = ast->nested_name_specifier_list; it; it = it->next) {
const Name *class_or_namespace_name = this->nestedNameSpecifier(it->value);
@@ -3236,7 +3236,7 @@ bool Bind::visit(NestedDeclaratorAST *ast)
// PostfixDeclaratorAST
bool Bind::visit(FunctionDeclaratorAST *ast)
{
Function *fun = control()->newFunction(0, 0);
Function *fun = control()->newFunction(0, nullptr);
fun->setStartOffset(tokenAt(ast->firstToken()).utf16charsBegin());
fun->setEndOffset(tokenAt(ast->lastToken() - 1).utf16charsEnd());
if (ast->trailing_return_type)
@@ -3266,7 +3266,7 @@ bool Bind::visit(FunctionDeclaratorAST *ast)
}
this->exceptionSpecification(ast->exception_specification, type);
if (ast->as_cpp_initializer != 0) {
if (ast->as_cpp_initializer != nullptr) {
fun->setAmbiguous(true);
/*ExpressionTy as_cpp_initializer =*/ this->expression(ast->as_cpp_initializer);
}

View File

@@ -209,21 +209,21 @@ class Control::Data
public:
Data(Control *control)
: control(control)
, translationUnit(0)
, diagnosticClient(0)
, deprecatedId(0)
, unavailableId(0)
, objcGetterId(0)
, objcSetterId(0)
, objcReadwriteId(0)
, objcReadonlyId(0)
, objcAssignId(0)
, objcRetainId(0)
, objcCopyId(0)
, objcNonatomicId(0)
, cpp11Override(0)
, cpp11Final(0)
, processor(0)
, translationUnit(nullptr)
, diagnosticClient(nullptr)
, deprecatedId(nullptr)
, unavailableId(nullptr)
, objcGetterId(nullptr)
, objcSetterId(nullptr)
, objcReadwriteId(nullptr)
, objcReadonlyId(nullptr)
, objcAssignId(nullptr)
, objcRetainId(nullptr)
, objcCopyId(nullptr)
, objcNonatomicId(nullptr)
, cpp11Override(nullptr)
, cpp11Final(nullptr)
, processor(nullptr)
{}
~Data()
@@ -574,7 +574,7 @@ const OperatorNameId *Control::findOperatorNameId(OperatorNameId::Kind operatorI
{
Table<OperatorNameId>::const_iterator i = d->operatorNameIds.find(operatorId);
if (i == d->operatorNameIds.end())
return 0;
return nullptr;
else
return &*i;
}
@@ -798,7 +798,7 @@ const Identifier *Control::cpp11Final() const
Symbol **Control::firstSymbol() const
{
if (d->symbols.empty())
return 0;
return nullptr;
return &*d->symbols.begin();
}
@@ -806,7 +806,7 @@ Symbol **Control::firstSymbol() const
Symbol **Control::lastSymbol() const
{
if (d->symbols.empty())
return 0;
return nullptr;
return &*d->symbols.begin() + d->symbols.size();
}

View File

@@ -54,7 +54,7 @@ public:
/// Returns the canonical template name id.
const TemplateNameId *templateNameId(const Identifier *id,
bool isSpecialization,
const FullySpecifiedType *const args = 0,
const FullySpecifiedType *const args = nullptr,
int argc = 0);
/// Returns the canonical destructor name id.
@@ -105,67 +105,67 @@ public:
EnumeratorDeclaration *newEnumeratorDeclaration(int sourceLocation, const Name *name);
/// Creates a new Argument symbol.
Argument *newArgument(int sourceLocation, const Name *name = 0);
Argument *newArgument(int sourceLocation, const Name *name = nullptr);
/// Creates a new Argument symbol.
TypenameArgument *newTypenameArgument(int sourceLocation, const Name *name = 0);
TypenameArgument *newTypenameArgument(int sourceLocation, const Name *name = nullptr);
/// Creates a new Function symbol.
Function *newFunction(int sourceLocation, const Name *name = 0);
Function *newFunction(int sourceLocation, const Name *name = nullptr);
/// Creates a new Namespace symbol.
Namespace *newNamespace(int sourceLocation, const Name *name = 0);
Namespace *newNamespace(int sourceLocation, const Name *name = nullptr);
/// Creates a new Template symbol.
Template *newTemplate(int sourceLocation, const Name *name = 0);
Template *newTemplate(int sourceLocation, const Name *name = nullptr);
/// Creates a new Namespace symbol.
NamespaceAlias *newNamespaceAlias(int sourceLocation, const Name *name = 0);
NamespaceAlias *newNamespaceAlias(int sourceLocation, const Name *name = nullptr);
/// Creates a new BaseClass symbol.
BaseClass *newBaseClass(int sourceLocation, const Name *name = 0);
BaseClass *newBaseClass(int sourceLocation, const Name *name = nullptr);
/// Creates a new Class symbol.
Class *newClass(int sourceLocation, const Name *name = 0);
Class *newClass(int sourceLocation, const Name *name = nullptr);
/// Creates a new Enum symbol.
Enum *newEnum(int sourceLocation, const Name *name = 0);
Enum *newEnum(int sourceLocation, const Name *name = nullptr);
/// Creates a new Block symbol.
Block *newBlock(int sourceLocation);
/// Creates a new UsingNamespaceDirective symbol.
UsingNamespaceDirective *newUsingNamespaceDirective(int sourceLocation, const Name *name = 0);
UsingNamespaceDirective *newUsingNamespaceDirective(int sourceLocation, const Name *name = nullptr);
/// Creates a new UsingDeclaration symbol.
UsingDeclaration *newUsingDeclaration(int sourceLocation, const Name *name = 0);
UsingDeclaration *newUsingDeclaration(int sourceLocation, const Name *name = nullptr);
/// Creates a new ForwardClassDeclaration symbol.
ForwardClassDeclaration *newForwardClassDeclaration(int sourceLocation, const Name *name = 0);
ForwardClassDeclaration *newForwardClassDeclaration(int sourceLocation, const Name *name = nullptr);
/// Creates a new QtPropertyDeclaration symbol.
QtPropertyDeclaration *newQtPropertyDeclaration(int sourceLocation, const Name *name = 0);
QtPropertyDeclaration *newQtPropertyDeclaration(int sourceLocation, const Name *name = nullptr);
/// Creates a new QtEnum symbol.
QtEnum *newQtEnum(int sourceLocation, const Name *name = 0);
QtEnum *newQtEnum(int sourceLocation, const Name *name = nullptr);
ObjCBaseClass *newObjCBaseClass(int sourceLocation, const Name *name);
ObjCBaseProtocol *newObjCBaseProtocol(int sourceLocation, const Name *name);
/// Creates a new Objective-C class symbol.
ObjCClass *newObjCClass(int sourceLocation, const Name *name = 0);
ObjCClass *newObjCClass(int sourceLocation, const Name *name = nullptr);
/// Creates a new Objective-C class forward declaration symbol.
ObjCForwardClassDeclaration *newObjCForwardClassDeclaration(int sourceLocation, const Name *name = 0);
ObjCForwardClassDeclaration *newObjCForwardClassDeclaration(int sourceLocation, const Name *name = nullptr);
/// Creates a new Objective-C protocol symbol.
ObjCProtocol *newObjCProtocol(int sourceLocation, const Name *name = 0);
ObjCProtocol *newObjCProtocol(int sourceLocation, const Name *name = nullptr);
/// Creates a new Objective-C protocol forward declaration symbol.
ObjCForwardProtocolDeclaration *newObjCForwardProtocolDeclaration(int sourceLocation, const Name *name = 0);
ObjCForwardProtocolDeclaration *newObjCForwardProtocolDeclaration(int sourceLocation, const Name *name = nullptr);
/// Creates a new Objective-C method symbol.
ObjCMethod *newObjCMethod(int sourceLocation, const Name *name = 0);
ObjCMethod *newObjCMethod(int sourceLocation, const Name *name = nullptr);
/// Creates a new Objective-C @property declaration symbol.
ObjCPropertyDeclaration *newObjCPropertyDeclaration(int sourceLocation, const Name *name);

View File

@@ -28,7 +28,7 @@ namespace CPlusPlus {
class CPLUSPLUS_EXPORT FullySpecifiedType
{
public:
FullySpecifiedType(Type *type = 0);
FullySpecifiedType(Type *type = nullptr);
~FullySpecifiedType();
bool isValid() const;
@@ -103,7 +103,7 @@ public:
bool operator != (const FullySpecifiedType &other) const;
bool operator < (const FullySpecifiedType &other) const;
bool match(const FullySpecifiedType &otherTy, Matcher *matcher = 0) const;
bool match(const FullySpecifiedType &otherTy, Matcher *matcher = nullptr) const;
FullySpecifiedType simplified() const;

View File

@@ -64,8 +64,8 @@ Lexer::Lexer(TranslationUnit *unit)
}
Lexer::Lexer(const char *firstChar, const char *lastChar)
: _translationUnit(0),
_control(0),
: _translationUnit(nullptr),
_control(nullptr),
_state(0),
_flags(0),
_currentLine(1)
@@ -747,7 +747,7 @@ void Lexer::scanRawStringLiteral(Token *tok, unsigned char hint)
const char *yytext = _currentChar;
int delimLength = -1;
const char *closingDelimCandidate = 0;
const char *closingDelimCandidate = nullptr;
bool closed = false;
while (_yychar) {
if (_yychar == '(' && delimLength == -1) {
@@ -781,7 +781,7 @@ void Lexer::scanRawStringLiteral(Token *tok, unsigned char hint)
// Make sure this continues to be a valid candidate.
if (_yychar != *(yytext + (_currentChar - closingDelimCandidate)))
closingDelimCandidate = 0;
closingDelimCandidate = nullptr;
yyinp();
}

View File

@@ -36,8 +36,8 @@ public:
public:
LiteralTable()
: _literals(0),
_buckets(0),
: _literals(nullptr),
_buckets(nullptr),
_allocatedLiterals(0),
_literalCount(-1),
_allocatedBuckets(0)
@@ -59,8 +59,8 @@ public:
if (_buckets)
std::free(_buckets);
_literals = 0;
_buckets = 0;
_literals = nullptr;
_buckets = nullptr;
_allocatedLiterals = 0;
_literalCount = -1;
_allocatedBuckets = 0;
@@ -92,7 +92,7 @@ public:
}
}
return 0;
return nullptr;
}
const Literal *findOrInsertLiteral(const char *chars, int size)

View File

@@ -29,7 +29,7 @@ using namespace CPlusPlus;
////////////////////////////////////////////////////////////////////////////////
Literal::Literal(const char *chars, int size)
: _next(0), _index(0)
: _next(nullptr), _index(0)
{
_chars = new char[size + 1];

View File

@@ -38,8 +38,8 @@ public:
Matcher();
virtual ~Matcher();
static bool match(const Type *type, const Type *otherType, Matcher *matcher = 0);
static bool match(const Name *name, const Name *otherName, Matcher *matcher = 0);
static bool match(const Type *type, const Type *otherType, Matcher *matcher = nullptr);
static bool match(const Name *name, const Name *otherName, Matcher *matcher = nullptr);
virtual bool match(const UndefinedType *type, const UndefinedType *otherType);
virtual bool match(const VoidType *type, const VoidType *otherType);

View File

@@ -27,11 +27,11 @@
using namespace CPlusPlus;
MemoryPool::MemoryPool()
: _blocks(0),
: _blocks(nullptr),
_allocatedBlocks(0),
_blockCount(-1),
_ptr(0),
_end(0)
_ptr(nullptr),
_end(nullptr)
{ }
MemoryPool::~MemoryPool()
@@ -49,7 +49,7 @@ MemoryPool::~MemoryPool()
void MemoryPool::reset()
{
_blockCount = -1;
_ptr = _end = 0;
_ptr = _end = nullptr;
}
void *MemoryPool::allocate_helper(size_t size)
@@ -65,7 +65,7 @@ void *MemoryPool::allocate_helper(size_t size)
_blocks = (char **) realloc(_blocks, sizeof(char *) * _allocatedBlocks);
for (int index = _blockCount; index < _allocatedBlocks; ++index)
_blocks[index] = 0;
_blocks[index] = nullptr;
}
char *&block = _blocks[_blockCount];

View File

@@ -35,28 +35,28 @@ Name::~Name()
{ }
bool Name::isNameId() const
{ return asNameId() != 0; }
{ return asNameId() != nullptr; }
bool Name::isAnonymousNameId() const
{ return asAnonymousNameId() != 0; }
{ return asAnonymousNameId() != nullptr; }
bool Name::isTemplateNameId() const
{ return asTemplateNameId() != 0; }
{ return asTemplateNameId() != nullptr; }
bool Name::isDestructorNameId() const
{ return asDestructorNameId() != 0; }
{ return asDestructorNameId() != nullptr; }
bool Name::isOperatorNameId() const
{ return asOperatorNameId() != 0; }
{ return asOperatorNameId() != nullptr; }
bool Name::isConversionNameId() const
{ return asConversionNameId() != 0; }
{ return asConversionNameId() != nullptr; }
bool Name::isQualifiedNameId() const
{ return asQualifiedNameId() != 0; }
{ return asQualifiedNameId() != nullptr; }
bool Name::isSelectorNameId() const
{ return asSelectorNameId() != 0; }
{ return asSelectorNameId() != nullptr; }
void Name::accept(NameVisitor *visitor) const
{
@@ -79,9 +79,9 @@ bool Name::match(const Name *other, Matcher *matcher) const
bool Name::Compare::operator()(const Name *name, const Name *other) const
{
if (name == 0)
return other != 0;
if (other == 0)
if (name == nullptr)
return other != nullptr;
if (other == nullptr)
return false;
if (name == other)
return false;
@@ -89,9 +89,9 @@ bool Name::Compare::operator()(const Name *name, const Name *other) const
const Identifier *id = name->identifier();
const Identifier *otherId = other->identifier();
if (id == 0)
return otherId != 0;
if (otherId == 0)
if (id == nullptr)
return otherId != nullptr;
if (otherId == nullptr)
return false;
return std::strcmp(id->chars(), otherId->chars()) < 0;

View File

@@ -44,19 +44,19 @@ public:
bool isQualifiedNameId() const;
bool isSelectorNameId() const;
virtual const Identifier *asNameId() const { return 0; }
virtual const AnonymousNameId *asAnonymousNameId() const { return 0; }
virtual const TemplateNameId *asTemplateNameId() const { return 0; }
virtual const DestructorNameId *asDestructorNameId() const { return 0; }
virtual const OperatorNameId *asOperatorNameId() const { return 0; }
virtual const ConversionNameId *asConversionNameId() const { return 0; }
virtual const QualifiedNameId *asQualifiedNameId() const { return 0; }
virtual const SelectorNameId *asSelectorNameId() const { return 0; }
virtual const Identifier *asNameId() const { return nullptr; }
virtual const AnonymousNameId *asAnonymousNameId() const { return nullptr; }
virtual const TemplateNameId *asTemplateNameId() const { return nullptr; }
virtual const DestructorNameId *asDestructorNameId() const { return nullptr; }
virtual const OperatorNameId *asOperatorNameId() const { return nullptr; }
virtual const ConversionNameId *asConversionNameId() const { return nullptr; }
virtual const QualifiedNameId *asQualifiedNameId() const { return nullptr; }
virtual const SelectorNameId *asSelectorNameId() const { return nullptr; }
void accept(NameVisitor *visitor) const;
static void accept(const Name *name, NameVisitor *visitor);
bool match(const Name *other, Matcher *matcher = 0) const;
bool match(const Name *other, Matcher *matcher = nullptr) const;
public:
struct Compare {

View File

@@ -45,7 +45,7 @@ const Identifier *QualifiedNameId::identifier() const
if (const Name *u = name())
return u->identifier();
return 0;
return nullptr;
}
const Name *QualifiedNameId::base() const
@@ -102,9 +102,9 @@ const FullySpecifiedType &TemplateNameId::templateArgumentAt(int index) const
bool TemplateNameId::Compare::operator()(const TemplateNameId *name,
const TemplateNameId *other) const
{
if (name == 0)
return other != 0;
if (other == 0)
if (name == nullptr)
return other != nullptr;
if (other == nullptr)
return false;
if (name == other)
return false;
@@ -112,9 +112,9 @@ bool TemplateNameId::Compare::operator()(const TemplateNameId *name,
const Identifier *id = name->identifier();
const Identifier *otherId = other->identifier();
if (id == 0)
return otherId != 0;
if (otherId == 0)
if (id == nullptr)
return otherId != nullptr;
if (otherId == nullptr)
return false;
const int c = std::strcmp(id->chars(), otherId->chars());
@@ -154,7 +154,7 @@ OperatorNameId::Kind OperatorNameId::kind() const
{ return _kind; }
const Identifier *OperatorNameId::identifier() const
{ return 0; }
{ return nullptr; }
ConversionNameId::ConversionNameId(const FullySpecifiedType &type)
: _type(type)
@@ -177,7 +177,7 @@ FullySpecifiedType ConversionNameId::type() const
{ return _type; }
const Identifier *ConversionNameId::identifier() const
{ return 0; }
{ return nullptr; }
SelectorNameId::~SelectorNameId()
{ }
@@ -195,7 +195,7 @@ bool SelectorNameId::match0(const Name *otherName, Matcher *matcher) const
const Identifier *SelectorNameId::identifier() const
{
if (_names.empty())
return 0;
return nullptr;
return nameAt(0)->identifier();
}
@@ -232,4 +232,4 @@ bool AnonymousNameId::match0(const Name *otherName, Matcher *matcher) const
}
const Identifier *AnonymousNameId::identifier() const
{ return 0; }
{ return nullptr; }

File diff suppressed because it is too large Load Diff

View File

@@ -76,10 +76,10 @@ public:
bool parseOverrideFinalQualifiers(SpecifierListAST *&node);
bool parseDeclaratorOrAbstractDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specifier_list);
bool parseDeclaration(DeclarationAST *&node);
bool parseSimpleDeclaration(DeclarationAST *&node, ClassSpecifierAST *declaringClass = 0);
bool parseSimpleDeclaration(DeclarationAST *&node, ClassSpecifierAST *declaringClass = nullptr);
bool parseDeclarationStatement(StatementAST *&node);
bool parseCoreDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specifier_list, ClassSpecifierAST *declaringClass);
bool parseDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specifier_list, ClassSpecifierAST *declaringClass = 0);
bool parseDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specifier_list, ClassSpecifierAST *declaringClass = nullptr);
bool parseDeleteExpression(ExpressionAST *&node);
bool parseDoStatement(StatementAST *&node);
bool parseElaboratedTypeSpecifier(SpecifierListAST *&node);
@@ -213,9 +213,9 @@ public:
bool parseObjCExpression(ExpressionAST *&node);
bool parseObjCClassForwardDeclaration(DeclarationAST *&node);
bool parseObjCInterface(DeclarationAST *&node,
SpecifierListAST *attributes = 0);
SpecifierListAST *attributes = nullptr);
bool parseObjCProtocol(DeclarationAST *&node,
SpecifierListAST *attributes = 0);
SpecifierListAST *attributes = nullptr);
bool parseObjCTryStatement(StatementAST *&node);
bool parseObjCSynchronizedStatement(StatementAST *&node);
@@ -236,7 +236,7 @@ public:
bool parseObjCInterfaceMemberDeclaration(DeclarationAST *&node);
bool parseObjCInstanceVariableDeclaration(DeclarationAST *&node);
bool parseObjCPropertyDeclaration(DeclarationAST *&node,
SpecifierListAST *attributes = 0);
SpecifierListAST *attributes = nullptr);
bool parseObjCImplementation(DeclarationAST *&node);
bool parseObjCMethodPrototype(ObjCMethodPrototypeAST *&node);
bool parseObjCPropertyAttribute(ObjCPropertyAttributeAST *&node);
@@ -303,7 +303,7 @@ public:
int cursor;
ExpressionListAST *ast;
TemplateArgumentListEntry(int index = 0, int cursor = 0, ExpressionListAST *ast = 0)
TemplateArgumentListEntry(int index = 0, int cursor = 0, ExpressionListAST *ast = nullptr)
: index(index), cursor(cursor), ast(ast) {}
};

View File

@@ -40,7 +40,7 @@ public:
public:
/// Constructs an empty Scope.
SymbolTable(Scope *owner = 0);
SymbolTable(Scope *owner = nullptr);
/// Destroy this scope.
~SymbolTable();
@@ -92,8 +92,8 @@ private:
SymbolTable::SymbolTable(Scope *owner)
: _owner(owner),
_symbols(0),
_hash(0),
_symbols(nullptr),
_hash(nullptr),
_allocatedSymbols(0),
_symbolCount(-1),
_hashSize(0)
@@ -136,7 +136,7 @@ void SymbolTable::enterSymbol(Symbol *symbol)
Symbol *SymbolTable::lookat(const Identifier *id) const
{
if (! _hash || ! id)
return 0;
return nullptr;
const unsigned h = id->hashCode() % _hashSize;
Symbol *symbol = _hash[h];
@@ -154,7 +154,7 @@ Symbol *SymbolTable::lookat(const Identifier *id) const
if (d->identifier()->match(id))
break;
} else if (identity->isQualifiedNameId()) {
return 0;
return nullptr;
} else if (const SelectorNameId *selectorNameId = identity->asSelectorNameId()) {
if (selectorNameId->identifier()->match(id))
break;
@@ -166,7 +166,7 @@ Symbol *SymbolTable::lookat(const Identifier *id) const
Symbol *SymbolTable::lookat(OperatorNameId::Kind operatorId) const
{
if (! _hash)
return 0;
return nullptr;
const unsigned h = operatorId % _hashSize;
Symbol *symbol = _hash[h];
@@ -216,7 +216,7 @@ int SymbolTable::symbolCount() const
Symbol *SymbolTable::symbolAt(int index) const
{
if (! _symbols)
return 0;
return nullptr;
return _symbols[index];
}
@@ -228,14 +228,14 @@ SymbolTable::iterator SymbolTable::lastSymbol() const
Scope::Scope(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
: Symbol(translationUnit, sourceLocation, name),
_members(0),
_members(nullptr),
_startOffset(0),
_endOffset(0)
{ }
Scope::Scope(Clone *clone, Subst *subst, Scope *original)
: Symbol(clone, subst, original)
, _members(0)
, _members(nullptr)
, _startOffset(original->_startOffset)
, _endOffset(original->_endOffset)
{
@@ -265,21 +265,21 @@ int Scope::memberCount() const
/// Returns the Symbol at the given position.
Symbol *Scope::memberAt(int index) const
{ return _members ? _members->symbolAt(index) : 0; }
{ return _members ? _members->symbolAt(index) : nullptr; }
/// Returns the first Symbol in the scope.
Scope::iterator Scope::memberBegin() const
{ return _members ? _members->firstSymbol() : 0; }
{ return _members ? _members->firstSymbol() : nullptr; }
/// Returns the last Symbol in the scope.
Scope::iterator Scope::memberEnd() const
{ return _members ? _members->lastSymbol() : 0; }
{ return _members ? _members->lastSymbol() : nullptr; }
Symbol *Scope::find(const Identifier *id) const
{ return _members ? _members->lookat(id) : 0; }
{ return _members ? _members->lookat(id) : nullptr; }
Symbol *Scope::find(OperatorNameId::Kind operatorId) const
{ return _members ? _members->lookat(operatorId) : 0; }
{ return _members ? _members->lookat(operatorId) : nullptr; }
/// Set the start offset of the scope
int Scope::startOffset() const

View File

@@ -87,10 +87,10 @@ private:
};
Symbol::Symbol(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
: _name(0),
_enclosingScope(0),
_next(0),
_fileId(0),
: _name(nullptr),
_enclosingScope(nullptr),
_next(nullptr),
_fileId(nullptr),
_sourceLocation(0),
_hashCode(0),
_storage(Symbol::NoStorage),
@@ -108,8 +108,8 @@ Symbol::Symbol(TranslationUnit *translationUnit, int sourceLocation, const Name
Symbol::Symbol(Clone *clone, Subst *subst, Symbol *original)
: _name(clone->name(original->_name, subst)),
_enclosingScope(0),
_next(0),
_enclosingScope(nullptr),
_next(nullptr),
_fileId(clone->control()->stringLiteral(original->fileName(), original->fileNameLength())),
_sourceLocation(original->_sourceLocation),
_hashCode(original->_hashCode),
@@ -172,7 +172,7 @@ void Symbol::setSourceLocation(int sourceLocation, TranslationUnit *translationU
_isGenerated = false;
_line = 0;
_column = 0;
_fileId = 0;
_fileId = nullptr;
}
}
@@ -200,7 +200,7 @@ int Symbol::fileNameLength() const
const Name *Symbol::unqualifiedName() const
{
if (! _name)
return 0;
return nullptr;
else if (const QualifiedNameId *q = _name->asQualifiedNameId())
return q->name();
@@ -228,7 +228,7 @@ const Identifier *Symbol::identifier() const
if (_name)
return _name->identifier();
return 0;
return nullptr;
}
Scope *Symbol::enclosingScope() const
@@ -242,7 +242,7 @@ void Symbol::setEnclosingScope(Scope *scope)
void Symbol::resetEnclosingScope()
{
_enclosingScope = 0;
_enclosingScope = nullptr;
}
Namespace *Symbol::enclosingNamespace() const
@@ -251,7 +251,7 @@ Namespace *Symbol::enclosingNamespace() const
if (Namespace *ns = s->asNamespace())
return ns;
}
return 0;
return nullptr;
}
Template *Symbol::enclosingTemplate() const
@@ -260,7 +260,7 @@ Template *Symbol::enclosingTemplate() const
if (Template *templ = s->asTemplate())
return templ;
}
return 0;
return nullptr;
}
Class *Symbol::enclosingClass() const
@@ -269,7 +269,7 @@ Class *Symbol::enclosingClass() const
if (Class *klass = s->asClass())
return klass;
}
return 0;
return nullptr;
}
Enum *Symbol::enclosingEnum() const
@@ -278,7 +278,7 @@ Enum *Symbol::enclosingEnum() const
if (Enum *e = s->asEnum())
return e;
}
return 0;
return nullptr;
}
Function *Symbol::enclosingFunction() const
@@ -287,7 +287,7 @@ Function *Symbol::enclosingFunction() const
if (Function *fun = s->asFunction())
return fun;
}
return 0;
return nullptr;
}
Block *Symbol::enclosingBlock() const
@@ -296,7 +296,7 @@ Block *Symbol::enclosingBlock() const
if (Block *block = s->asBlock())
return block;
}
return 0;
return nullptr;
}
unsigned Symbol::index() const
@@ -348,76 +348,76 @@ bool Symbol::isPrivate() const
{ return _visibility == Private; }
bool Symbol::isScope() const
{ return asScope() != 0; }
{ return asScope() != nullptr; }
bool Symbol::isEnum() const
{ return asEnum() != 0; }
{ return asEnum() != nullptr; }
bool Symbol::isFunction() const
{ return asFunction() != 0; }
{ return asFunction() != nullptr; }
bool Symbol::isNamespace() const
{ return asNamespace() != 0; }
{ return asNamespace() != nullptr; }
bool Symbol::isTemplate() const
{ return asTemplate() != 0; }
{ return asTemplate() != nullptr; }
bool Symbol::isClass() const
{ return asClass() != 0; }
{ return asClass() != nullptr; }
bool Symbol::isForwardClassDeclaration() const
{ return asForwardClassDeclaration() != 0; }
{ return asForwardClassDeclaration() != nullptr; }
bool Symbol::isQtPropertyDeclaration() const
{ return asQtPropertyDeclaration() != 0; }
{ return asQtPropertyDeclaration() != nullptr; }
bool Symbol::isQtEnum() const
{ return asQtEnum() != 0; }
{ return asQtEnum() != nullptr; }
bool Symbol::isBlock() const
{ return asBlock() != 0; }
{ return asBlock() != nullptr; }
bool Symbol::isUsingNamespaceDirective() const
{ return asUsingNamespaceDirective() != 0; }
{ return asUsingNamespaceDirective() != nullptr; }
bool Symbol::isUsingDeclaration() const
{ return asUsingDeclaration() != 0; }
{ return asUsingDeclaration() != nullptr; }
bool Symbol::isDeclaration() const
{ return asDeclaration() != 0; }
{ return asDeclaration() != nullptr; }
bool Symbol::isArgument() const
{ return asArgument() != 0; }
{ return asArgument() != nullptr; }
bool Symbol::isTypenameArgument() const
{ return asTypenameArgument() != 0; }
{ return asTypenameArgument() != nullptr; }
bool Symbol::isBaseClass() const
{ return asBaseClass() != 0; }
{ return asBaseClass() != nullptr; }
bool Symbol::isObjCBaseClass() const
{ return asObjCBaseClass() != 0; }
{ return asObjCBaseClass() != nullptr; }
bool Symbol::isObjCBaseProtocol() const
{ return asObjCBaseProtocol() != 0; }
{ return asObjCBaseProtocol() != nullptr; }
bool Symbol::isObjCClass() const
{ return asObjCClass() != 0; }
{ return asObjCClass() != nullptr; }
bool Symbol::isObjCForwardClassDeclaration() const
{ return asObjCForwardClassDeclaration() != 0; }
{ return asObjCForwardClassDeclaration() != nullptr; }
bool Symbol::isObjCProtocol() const
{ return asObjCProtocol() != 0; }
{ return asObjCProtocol() != nullptr; }
bool Symbol::isObjCForwardProtocolDeclaration() const
{ return asObjCForwardProtocolDeclaration() != 0; }
{ return asObjCForwardProtocolDeclaration() != nullptr; }
bool Symbol::isObjCMethod() const
{ return asObjCMethod() != 0; }
{ return asObjCMethod() != nullptr; }
bool Symbol::isObjCPropertyDeclaration() const
{ return asObjCPropertyDeclaration() != 0; }
{ return asObjCPropertyDeclaration() != nullptr; }
void Symbol::copy(Symbol *other)
{

View File

@@ -200,57 +200,57 @@ public:
Utils::Link toLink() const;
virtual const Scope *asScope() const { return 0; }
virtual const Enum *asEnum() const { return 0; }
virtual const Function *asFunction() const { return 0; }
virtual const Namespace *asNamespace() const { return 0; }
virtual const Template *asTemplate() const { return 0; }
virtual const NamespaceAlias *asNamespaceAlias() const { return 0; }
virtual const Class *asClass() const { return 0; }
virtual const Block *asBlock() const { return 0; }
virtual const UsingNamespaceDirective *asUsingNamespaceDirective() const { return 0; }
virtual const UsingDeclaration *asUsingDeclaration() const { return 0; }
virtual const Declaration *asDeclaration() const { return 0; }
virtual const Argument *asArgument() const { return 0; }
virtual const TypenameArgument *asTypenameArgument() const { return 0; }
virtual const BaseClass *asBaseClass() const { return 0; }
virtual const ForwardClassDeclaration *asForwardClassDeclaration() const { return 0; }
virtual const QtPropertyDeclaration *asQtPropertyDeclaration() const { return 0; }
virtual const QtEnum *asQtEnum() const { return 0; }
virtual const ObjCBaseClass *asObjCBaseClass() const { return 0; }
virtual const ObjCBaseProtocol *asObjCBaseProtocol() const { return 0; }
virtual const ObjCClass *asObjCClass() const { return 0; }
virtual const ObjCForwardClassDeclaration *asObjCForwardClassDeclaration() const { return 0; }
virtual const ObjCProtocol *asObjCProtocol() const { return 0; }
virtual const ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclaration() const { return 0; }
virtual const ObjCMethod *asObjCMethod() const { return 0; }
virtual const ObjCPropertyDeclaration *asObjCPropertyDeclaration() const { return 0; }
virtual const Scope *asScope() const { return nullptr; }
virtual const Enum *asEnum() const { return nullptr; }
virtual const Function *asFunction() const { return nullptr; }
virtual const Namespace *asNamespace() const { return nullptr; }
virtual const Template *asTemplate() const { return nullptr; }
virtual const NamespaceAlias *asNamespaceAlias() const { return nullptr; }
virtual const Class *asClass() const { return nullptr; }
virtual const Block *asBlock() const { return nullptr; }
virtual const UsingNamespaceDirective *asUsingNamespaceDirective() const { return nullptr; }
virtual const UsingDeclaration *asUsingDeclaration() const { return nullptr; }
virtual const Declaration *asDeclaration() const { return nullptr; }
virtual const Argument *asArgument() const { return nullptr; }
virtual const TypenameArgument *asTypenameArgument() const { return nullptr; }
virtual const BaseClass *asBaseClass() const { return nullptr; }
virtual const ForwardClassDeclaration *asForwardClassDeclaration() const { return nullptr; }
virtual const QtPropertyDeclaration *asQtPropertyDeclaration() const { return nullptr; }
virtual const QtEnum *asQtEnum() const { return nullptr; }
virtual const ObjCBaseClass *asObjCBaseClass() const { return nullptr; }
virtual const ObjCBaseProtocol *asObjCBaseProtocol() const { return nullptr; }
virtual const ObjCClass *asObjCClass() const { return nullptr; }
virtual const ObjCForwardClassDeclaration *asObjCForwardClassDeclaration() const { return nullptr; }
virtual const ObjCProtocol *asObjCProtocol() const { return nullptr; }
virtual const ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclaration() const { return nullptr; }
virtual const ObjCMethod *asObjCMethod() const { return nullptr; }
virtual const ObjCPropertyDeclaration *asObjCPropertyDeclaration() const { return nullptr; }
virtual Scope *asScope() { return 0; }
virtual Enum *asEnum() { return 0; }
virtual Function *asFunction() { return 0; }
virtual Namespace *asNamespace() { return 0; }
virtual Template *asTemplate() { return 0; }
virtual NamespaceAlias *asNamespaceAlias() { return 0; }
virtual Class *asClass() { return 0; }
virtual Block *asBlock() { return 0; }
virtual UsingNamespaceDirective *asUsingNamespaceDirective() { return 0; }
virtual UsingDeclaration *asUsingDeclaration() { return 0; }
virtual Declaration *asDeclaration() { return 0; }
virtual Argument *asArgument() { return 0; }
virtual TypenameArgument *asTypenameArgument() { return 0; }
virtual BaseClass *asBaseClass() { return 0; }
virtual ForwardClassDeclaration *asForwardClassDeclaration() { return 0; }
virtual QtPropertyDeclaration *asQtPropertyDeclaration() { return 0; }
virtual QtEnum *asQtEnum() { return 0; }
virtual ObjCBaseClass *asObjCBaseClass() { return 0; }
virtual ObjCBaseProtocol *asObjCBaseProtocol() { return 0; }
virtual ObjCClass *asObjCClass() { return 0; }
virtual ObjCForwardClassDeclaration *asObjCForwardClassDeclaration() { return 0; }
virtual ObjCProtocol *asObjCProtocol() { return 0; }
virtual ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclaration() { return 0; }
virtual ObjCMethod *asObjCMethod() { return 0; }
virtual ObjCPropertyDeclaration *asObjCPropertyDeclaration() { return 0; }
virtual Scope *asScope() { return nullptr; }
virtual Enum *asEnum() { return nullptr; }
virtual Function *asFunction() { return nullptr; }
virtual Namespace *asNamespace() { return nullptr; }
virtual Template *asTemplate() { return nullptr; }
virtual NamespaceAlias *asNamespaceAlias() { return nullptr; }
virtual Class *asClass() { return nullptr; }
virtual Block *asBlock() { return nullptr; }
virtual UsingNamespaceDirective *asUsingNamespaceDirective() { return nullptr; }
virtual UsingDeclaration *asUsingDeclaration() { return nullptr; }
virtual Declaration *asDeclaration() { return nullptr; }
virtual Argument *asArgument() { return nullptr; }
virtual TypenameArgument *asTypenameArgument() { return nullptr; }
virtual BaseClass *asBaseClass() { return nullptr; }
virtual ForwardClassDeclaration *asForwardClassDeclaration() { return nullptr; }
virtual QtPropertyDeclaration *asQtPropertyDeclaration() { return nullptr; }
virtual QtEnum *asQtEnum() { return nullptr; }
virtual ObjCBaseClass *asObjCBaseClass() { return nullptr; }
virtual ObjCBaseProtocol *asObjCBaseProtocol() { return nullptr; }
virtual ObjCClass *asObjCClass() { return nullptr; }
virtual ObjCForwardClassDeclaration *asObjCForwardClassDeclaration() { return nullptr; }
virtual ObjCProtocol *asObjCProtocol() { return nullptr; }
virtual ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclaration() { return nullptr; }
virtual ObjCMethod *asObjCMethod() { return nullptr; }
virtual ObjCPropertyDeclaration *asObjCPropertyDeclaration() { return nullptr; }
/// Returns this Symbol's type.
virtual FullySpecifiedType type() const = 0;

View File

@@ -53,7 +53,7 @@ void UsingNamespaceDirective::visitSymbol0(SymbolVisitor *visitor)
NamespaceAlias::NamespaceAlias(TranslationUnit *translationUnit,
int sourceLocation, const Name *name)
: Symbol(translationUnit, sourceLocation, name), _namespaceName(0)
: Symbol(translationUnit, sourceLocation, name), _namespaceName(nullptr)
{ }
NamespaceAlias::NamespaceAlias(Clone *clone, Subst *subst, NamespaceAlias *original)
@@ -97,7 +97,7 @@ void UsingDeclaration::visitSymbol0(SymbolVisitor *visitor)
Declaration::Declaration(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
: Symbol(translationUnit, sourceLocation, name)
, _initializer(0)
, _initializer(nullptr)
{ }
Declaration::Declaration(Clone *clone, Subst *subst, Declaration *original)
@@ -158,7 +158,7 @@ Declaration::Declaration(Clone *clone, Subst *subst, Declaration *original)
std::strcmp(enNamespaceNameId, "__cxx11") == 0) {
if (std::strcmp(enClassNameId, "unique_ptr") == 0) {
if (std::strcmp(nameId, "pointer") == 0) {
newType = clone->type(subst->apply(firstTemplParamName), 0);
newType = clone->type(subst->apply(firstTemplParamName), nullptr);
newType = FullySpecifiedType(clone->control()->pointerType(newType));
}
} else if (std::strcmp(enClassNameId, "list") == 0 ||
@@ -172,12 +172,12 @@ Declaration::Declaration(Clone *clone, Subst *subst, Declaration *original)
std::strcmp(enClassNameId, "array") == 0) {
if (std::strcmp(nameId, "reference") == 0 ||
std::strcmp(nameId, "const_reference") == 0) {
newType = clone->type(subst->apply(firstTemplParamName), 0);
newType = clone->type(subst->apply(firstTemplParamName), nullptr);
} else if (std::strcmp(nameId, "iterator") == 0 ||
std::strcmp(nameId, "reverse_iterator") == 0 ||
std::strcmp(nameId, "const_reverse_iterator") == 0 ||
std::strcmp(nameId, "const_iterator") == 0) {
newType = clone->type(subst->apply(firstTemplParamName), 0);
newType = clone->type(subst->apply(firstTemplParamName), nullptr);
newType = FullySpecifiedType(clone->control()->pointerType(newType));
}
} else if (std::strcmp(enClassNameId, "_Hash") == 0 ||
@@ -186,12 +186,12 @@ Declaration::Declaration(Clone *clone, Subst *subst, Declaration *original)
std::strcmp(nameId, "reverse_iterator") == 0 ||
std::strcmp(nameId, "const_reverse_iterator") == 0 ||
std::strcmp(nameId, "const_iterator") == 0) {
FullySpecifiedType clonedType = clone->type(subst->apply(firstTemplParamName), 0);
FullySpecifiedType clonedType = clone->type(subst->apply(firstTemplParamName), nullptr);
if (NamedType *namedType = clonedType.type()->asNamedType()) {
if (const TemplateNameId * templateNameId =
namedType->name()->asTemplateNameId()) {
if (templateNameId->templateArgumentCount()) {
newType = clone->type(templateNameId->templateArgumentAt(0), 0);
newType = clone->type(templateNameId->templateArgumentAt(0), nullptr);
newType = FullySpecifiedType(clone->control()->pointerType(newType));
}
}
@@ -228,7 +228,7 @@ void Declaration::visitSymbol0(SymbolVisitor *visitor)
EnumeratorDeclaration::EnumeratorDeclaration(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
: Declaration(translationUnit, sourceLocation, name)
, _constantValue(0)
, _constantValue(nullptr)
{}
EnumeratorDeclaration::~EnumeratorDeclaration()
@@ -242,7 +242,7 @@ void EnumeratorDeclaration::setConstantValue(const StringLiteral *constantValue)
Argument::Argument(TranslationUnit *translationUnit, int sourceLocation, const Name *name)
: Symbol(translationUnit, sourceLocation, name),
_initializer(0)
_initializer(nullptr)
{ }
Argument::Argument(Clone *clone, Subst *subst, Argument *original)
@@ -255,7 +255,7 @@ Argument::~Argument()
{ }
bool Argument::hasInitializer() const
{ return _initializer != 0; }
{ return _initializer != nullptr; }
const StringLiteral *Argument::initializer() const
{ return _initializer; }
@@ -421,7 +421,7 @@ Symbol *Function::argumentAt(int index) const
}
}
return 0;
return nullptr;
}
bool Function::hasArguments() const
@@ -536,7 +536,7 @@ bool Function::maybeValidPrototype(int actualArgumentCount) const
Block::Block(TranslationUnit *translationUnit, int sourceLocation)
: Scope(translationUnit, sourceLocation, /*name = */ 0)
: Scope(translationUnit, sourceLocation, /*name = */ nullptr)
{ }
Block::Block(Clone *clone, Subst *subst, Block *original)
@@ -617,7 +617,7 @@ Template::~Template()
int Template::templateParameterCount() const
{
if (declaration() != 0)
if (declaration() != nullptr)
return memberCount() - 1;
return 0;
@@ -629,7 +629,7 @@ Symbol *Template::templateParameterAt(int index) const
Symbol *Template::declaration() const
{
if (isEmpty())
return 0;
return nullptr;
if (Symbol *s = memberAt(memberCount() - 1)) {
if (s->isClass() || s->isForwardClassDeclaration() ||
@@ -637,7 +637,7 @@ Symbol *Template::declaration() const
return s;
}
return 0;
return nullptr;
}
FullySpecifiedType Template::type() const
@@ -913,15 +913,15 @@ void ObjCBaseProtocol::visitSymbol0(SymbolVisitor *visitor)
ObjCClass::ObjCClass(TranslationUnit *translationUnit, int sourceLocation, const Name *name):
Scope(translationUnit, sourceLocation, name),
_categoryName(0),
_baseClass(0),
_categoryName(nullptr),
_baseClass(nullptr),
_isInterface(false)
{ }
ObjCClass::ObjCClass(Clone *clone, Subst *subst, ObjCClass *original)
: Scope(clone, subst, original)
, _categoryName(clone->name(original->_categoryName, subst))
, _baseClass(0)
, _baseClass(nullptr)
, _isInterface(original->_isInterface)
{
if (original->_baseClass)
@@ -940,7 +940,7 @@ void ObjCClass::setInterface(bool isInterface)
{ _isInterface = isInterface; }
bool ObjCClass::isCategory() const
{ return _categoryName != 0; }
{ return _categoryName != nullptr; }
const Name *ObjCClass::categoryName() const
{ return _categoryName; }
@@ -1175,8 +1175,8 @@ ObjCPropertyDeclaration::ObjCPropertyDeclaration(TranslationUnit *translationUni
int sourceLocation,
const Name *name):
Symbol(translationUnit, sourceLocation, name),
_getterName(0),
_setterName(0),
_getterName(nullptr),
_setterName(nullptr),
_propertyAttributes(None)
{}

View File

@@ -116,10 +116,10 @@ public:
{ return this; }
virtual EnumeratorDeclaration *asEnumeratorDeclarator()
{ return 0; }
{ return nullptr; }
virtual const EnumeratorDeclaration *asEnumeratorDeclarator() const
{ return 0; }
{ return nullptr; }
protected:
virtual void visitSymbol0(SymbolVisitor *visitor);
@@ -356,7 +356,7 @@ public:
RefQualifier refQualifier() const;
void setRefQualifier(RefQualifier refQualifier);
bool isSignatureEqualTo(const Function *other, Matcher *matcher = 0) const;
bool isSignatureEqualTo(const Function *other, Matcher *matcher = nullptr) const;
bool isAmbiguous() const; // internal
void setAmbiguous(bool isAmbiguous); // internal

View File

@@ -34,7 +34,7 @@ using namespace CPlusPlus;
CloneType::CloneType(Clone *clone)
: _clone(clone)
, _control(clone->control())
, _subst(0)
, _subst(nullptr)
{
}
@@ -102,7 +102,7 @@ void CloneType::visit(NamedType *type)
const Name *name = _clone->name(type->name(), _subst);
FullySpecifiedType ty;
if (_subst)
ty = _clone->type(_subst->apply(name), 0);
ty = _clone->type(_subst->apply(name), nullptr);
if (! ty.isValid())
ty = _control->namedType(name);
_type.setType(ty.type());
@@ -177,15 +177,15 @@ void CloneType::visit(ObjCForwardProtocolDeclaration *type)
CloneSymbol::CloneSymbol(Clone *clone)
: _clone(clone)
, _control(clone->control())
, _subst(0)
, _symbol(0)
, _subst(nullptr)
, _symbol(nullptr)
{
}
Symbol *CloneSymbol::cloneSymbol(Symbol *symbol, Subst *subst)
{
if (! symbol)
return 0;
return nullptr;
SymbolSubstPair symbolSubstPair = std::make_pair(symbol, subst);
auto it = _cache.find(symbolSubstPair);
@@ -194,14 +194,14 @@ Symbol *CloneSymbol::cloneSymbol(Symbol *symbol, Subst *subst)
return it->second;
}
Symbol *r = 0;
Symbol *r = nullptr;
std::swap(_subst, subst);
std::swap(_symbol, r);
accept(symbol);
std::swap(_symbol, r);
std::swap(_subst, subst);
CPP_CHECK(r != 0);
CPP_CHECK(r != nullptr);
_cache[symbolSubstPair] = r;
return r;
}
@@ -401,28 +401,28 @@ bool CloneSymbol::visit(ObjCPropertyDeclaration *symbol)
CloneName::CloneName(Clone *clone)
: _clone(clone)
, _control(clone->control())
, _subst(0)
, _name(0)
, _subst(nullptr)
, _name(nullptr)
{
}
const Name *CloneName::cloneName(const Name *name, Subst *subst)
{
if (! name)
return 0;
return nullptr;
NameSubstPair nameSubstPair = std::make_pair(name, subst);
auto it = _cache.find(nameSubstPair);
if (it != _cache.end())
return it->second;
const Name *r = 0;
const Name *r = nullptr;
std::swap(_subst, subst);
std::swap(_name, r);
accept(name);
std::swap(_name, r);
std::swap(_subst, subst);
CPP_CHECK(r != 0);
CPP_CHECK(r != nullptr);
_cache[nameSubstPair] = r;
return r;
}
@@ -490,17 +490,17 @@ Clone::Clone(Control *control)
const StringLiteral *Clone::stringLiteral(const StringLiteral *literal)
{
return literal ? _control->stringLiteral(literal->chars(), literal->size()) : 0;
return literal ? _control->stringLiteral(literal->chars(), literal->size()) : nullptr;
}
const NumericLiteral *Clone::numericLiteral(const NumericLiteral *literal)
{
return literal ? _control->numericLiteral(literal->chars(), literal->size()) : 0;
return literal ? _control->numericLiteral(literal->chars(), literal->size()) : nullptr;
}
const Identifier *Clone::identifier(const Identifier *id)
{
return id ? _control->identifier(id->chars(), id->size()) : 0;
return id ? _control->identifier(id->chars(), id->size()) : nullptr;
}
FullySpecifiedType Clone::type(const FullySpecifiedType &type, Subst *subst)
@@ -524,7 +524,7 @@ Symbol *Clone::instantiate(Template *templ, const FullySpecifiedType *const args
for (int i = 0, e = std::min(templ->templateParameterCount(), argc); i < e; ++i) {
Symbol *formal = templ->templateParameterAt(i);
FullySpecifiedType actual = args[i];
subst.bind(name(formal->name(), 0), actual);
subst.bind(name(formal->name(), nullptr), actual);
}
if (argc < templ->templateParameterCount()) {
for (int i = argc; i < templ->templateParameterCount(); ++i) {
@@ -537,7 +537,7 @@ Symbol *Clone::instantiate(Template *templ, const FullySpecifiedType *const args
inst->setEnclosingScope(templ->enclosingScope());
return inst;
}
return 0;
return nullptr;
}
//
@@ -564,7 +564,7 @@ FullySpecifiedType Subst::apply(const Name *name) const
return control()->namedType(control()->qualifiedNameId(qualifiedBase,
qualifiedName));
}
else if(baseNamedType->name()->identifier() != 0) {
else if(baseNamedType->name()->identifier() != nullptr) {
const QualifiedNameId *clonedQualifiedNameId
= control()->qualifiedNameId(baseNamedType->name()->identifier(),
unqualified->name());

View File

@@ -40,7 +40,7 @@ class CPLUSPLUS_EXPORT Subst
Subst &operator = (const Subst &other);
public:
Subst(Control *control, Subst *previous = 0)
Subst(Control *control, Subst *previous = nullptr)
: _control(control)
, _previous(previous)
{ }
@@ -197,7 +197,7 @@ public:
Symbol *instantiate(Template *templ,
const FullySpecifiedType *const args, int argc,
Subst *subst = 0);
Subst *subst = nullptr);
private:
CloneType _type;

View File

@@ -247,7 +247,7 @@ void Token::reset()
flags = 0;
byteOffset = 0;
utf16charOffset = 0;
ptr = 0;
ptr = nullptr;
}
const char *Token::name(int kind)

View File

@@ -298,7 +298,7 @@ enum Kind {
class CPLUSPLUS_EXPORT Token
{
public:
Token() : flags(0), byteOffset(0), utf16charOffset(0), ptr(0) {}
Token() : flags(0), byteOffset(0), utf16charOffset(0), ptr(nullptr) {}
inline bool is(unsigned k) const { return f.kind == k; }
inline bool isNot(unsigned k) const { return f.kind != k; }

View File

@@ -43,10 +43,10 @@ const Token TranslationUnit::nullToken;
TranslationUnit::TranslationUnit(Control *control, const StringLiteral *fileId)
: _control(control),
_fileId(fileId),
_firstSourceChar(0),
_lastSourceChar(0),
_pool(0),
_ast(0),
_firstSourceChar(nullptr),
_lastSourceChar(nullptr),
_pool(nullptr),
_ast(nullptr),
_flags(0)
{
_tokens = new std::vector<Token>();
@@ -91,7 +91,7 @@ void TranslationUnit::setSource(const char *source, int size)
const char *TranslationUnit::spell(int index) const
{
if (! index)
return 0;
return nullptr;
return tokenAt(index).spell();
}
@@ -198,7 +198,7 @@ recognize:
// Get the total number of generated tokens and specify "null"
// information for them.
unsigned totalGenerated =
static_cast<int>(strtoul(tk.spell(), 0, 0));
static_cast<int>(strtoul(tk.spell(), nullptr, 0));
const std::size_t previousSize = lineColumn.size();
lineColumn.resize(previousSize + totalGenerated);
std::fill(lineColumn.begin() + previousSize,
@@ -207,10 +207,10 @@ recognize:
lex(&tk);
} else if (tk.is(T_NUMERIC_LITERAL)) {
int line = static_cast<int>(strtoul(tk.spell(), 0, 0));
int line = static_cast<int>(strtoul(tk.spell(), nullptr, 0));
lex(&tk);
lex(&tk); // Skip the separating colon
int column = static_cast<int>(strtoul(tk.spell(), 0, 0));
int column = static_cast<int>(strtoul(tk.spell(), nullptr, 0));
// Store line and column for this non-generated token.
lineColumn.push_back(std::make_pair(line, column));
@@ -230,7 +230,7 @@ recognize:
if (! tk.newline() && tk.is(T_IDENTIFIER) && tk.identifier == lineId)
lex(&tk);
if (! tk.newline() && tk.is(T_NUMERIC_LITERAL)) {
int line = static_cast<int>(strtol(tk.spell(), 0, 0));
int line = static_cast<int>(strtol(tk.spell(), nullptr, 0));
lex(&tk);
if (! tk.newline() && tk.is(T_STRING_LITERAL)) {
const StringLiteral *fileName =
@@ -302,31 +302,31 @@ bool TranslationUnit::parse(ParseMode mode)
switch (mode) {
case ParseTranlationUnit: {
TranslationUnitAST *node = 0;
TranslationUnitAST *node = nullptr;
parsed = parser.parseTranslationUnit(node);
_ast = node;
} break;
case ParseDeclaration: {
DeclarationAST *node = 0;
DeclarationAST *node = nullptr;
parsed = parser.parseDeclaration(node);
_ast = node;
} break;
case ParseExpression: {
ExpressionAST *node = 0;
ExpressionAST *node = nullptr;
parsed = parser.parseExpression(node);
_ast = node;
} break;
case ParseDeclarator: {
DeclaratorAST *node = 0;
parsed = parser.parseDeclarator(node, /*decl_specifier_list =*/ 0);
DeclaratorAST *node = nullptr;
parsed = parser.parseDeclarator(node, /*decl_specifier_list =*/ nullptr);
_ast = node;
} break;
case ParseStatement: {
StatementAST *node = 0;
StatementAST *node = nullptr;
parsed = parser.parseStatement(node);
_ast = node;
} break;
@@ -399,7 +399,7 @@ void TranslationUnit::getPosition(int utf16charOffset,
{
int lineNumber = 0;
int columnNumber = 0;
const StringLiteral *file = 0;
const StringLiteral *file = nullptr;
// If this token is expanded we already have the information directly from the expansion
// section header. Otherwise, we need to calculate it.
@@ -441,7 +441,7 @@ void TranslationUnit::message(DiagnosticClient::Level level, int index, const ch
index = std::min(index, tokenCount() - 1);
int line = 0, column = 0;
const StringLiteral *fileName = 0;
const StringLiteral *fileName = nullptr;
getTokenPosition(index, &line, &column, &fileName);
if (DiagnosticClient *client = control()->diagnosticClient())
@@ -529,16 +529,16 @@ bool TranslationUnit::maybeSplitGreaterGreaterToken(int tokenIndex)
void TranslationUnit::releaseTokensAndComments()
{
delete _tokens;
_tokens = 0;
_tokens = nullptr;
delete _comments;
_comments = 0;
_comments = nullptr;
}
void TranslationUnit::resetAST()
{
delete _pool;
_pool = 0;
_ast = 0;
_pool = nullptr;
_ast = nullptr;
}
void TranslationUnit::release()

View File

@@ -144,7 +144,7 @@ private:
PPLine(int utf16charOffset = 0,
int line = 0,
const StringLiteral *fileName = 0)
const StringLiteral *fileName = nullptr)
: utf16charOffset(utf16charOffset), line(line), fileName(fileName)
{ }

View File

@@ -36,61 +36,61 @@ bool Type::isUndefinedType() const
{ return this == UndefinedType::instance(); }
bool Type::isVoidType() const
{ return asVoidType() != 0; }
{ return asVoidType() != nullptr; }
bool Type::isIntegerType() const
{ return asIntegerType() != 0; }
{ return asIntegerType() != nullptr; }
bool Type::isFloatType() const
{ return asFloatType() != 0; }
{ return asFloatType() != nullptr; }
bool Type::isPointerType() const
{ return asPointerType() != 0; }
{ return asPointerType() != nullptr; }
bool Type::isPointerToMemberType() const
{ return asPointerToMemberType() != 0; }
{ return asPointerToMemberType() != nullptr; }
bool Type::isReferenceType() const
{ return asReferenceType() != 0; }
{ return asReferenceType() != nullptr; }
bool Type::isArrayType() const
{ return asArrayType() != 0; }
{ return asArrayType() != nullptr; }
bool Type::isNamedType() const
{ return asNamedType() != 0; }
{ return asNamedType() != nullptr; }
bool Type::isFunctionType() const
{ return asFunctionType() != 0; }
{ return asFunctionType() != nullptr; }
bool Type::isNamespaceType() const
{ return asNamespaceType() != 0; }
{ return asNamespaceType() != nullptr; }
bool Type::isTemplateType() const
{ return asTemplateType() != 0; }
{ return asTemplateType() != nullptr; }
bool Type::isClassType() const
{ return asClassType() != 0; }
{ return asClassType() != nullptr; }
bool Type::isEnumType() const
{ return asEnumType() != 0; }
{ return asEnumType() != nullptr; }
bool Type::isForwardClassDeclarationType() const
{ return asForwardClassDeclarationType() != 0; }
{ return asForwardClassDeclarationType() != nullptr; }
bool Type::isObjCClassType() const
{ return asObjCClassType() != 0; }
{ return asObjCClassType() != nullptr; }
bool Type::isObjCProtocolType() const
{ return asObjCProtocolType() != 0; }
{ return asObjCProtocolType() != nullptr; }
bool Type::isObjCMethodType() const
{ return asObjCMethodType() != 0; }
{ return asObjCMethodType() != nullptr; }
bool Type::isObjCForwardClassDeclarationType() const
{ return asObjCForwardClassDeclarationType() != 0; }
{ return asObjCForwardClassDeclarationType() != nullptr; }
bool Type::isObjCForwardProtocolDeclarationType() const
{ return asObjCForwardProtocolDeclarationType() != 0; }
{ return asObjCForwardProtocolDeclarationType() != nullptr; }
void Type::accept(TypeVisitor *visitor)
{

View File

@@ -51,52 +51,52 @@ public:
bool isObjCForwardClassDeclarationType() const;
bool isObjCForwardProtocolDeclarationType() const;
virtual const UndefinedType *asUndefinedType() const { return 0; }
virtual const VoidType *asVoidType() const { return 0; }
virtual const IntegerType *asIntegerType() const { return 0; }
virtual const FloatType *asFloatType() const { return 0; }
virtual const PointerType *asPointerType() const { return 0; }
virtual const PointerToMemberType *asPointerToMemberType() const { return 0; }
virtual const ReferenceType *asReferenceType() const { return 0; }
virtual const ArrayType *asArrayType() const { return 0; }
virtual const NamedType *asNamedType() const { return 0; }
virtual const Function *asFunctionType() const { return 0; }
virtual const Namespace *asNamespaceType() const { return 0; }
virtual const Template *asTemplateType() const { return 0; }
virtual const Class *asClassType() const { return 0; }
virtual const Enum *asEnumType() const { return 0; }
virtual const ForwardClassDeclaration *asForwardClassDeclarationType() const { return 0; }
virtual const ObjCClass *asObjCClassType() const { return 0; }
virtual const ObjCProtocol *asObjCProtocolType() const { return 0; }
virtual const ObjCMethod *asObjCMethodType() const { return 0; }
virtual const ObjCForwardClassDeclaration *asObjCForwardClassDeclarationType() const { return 0; }
virtual const ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclarationType() const { return 0; }
virtual const UndefinedType *asUndefinedType() const { return nullptr; }
virtual const VoidType *asVoidType() const { return nullptr; }
virtual const IntegerType *asIntegerType() const { return nullptr; }
virtual const FloatType *asFloatType() const { return nullptr; }
virtual const PointerType *asPointerType() const { return nullptr; }
virtual const PointerToMemberType *asPointerToMemberType() const { return nullptr; }
virtual const ReferenceType *asReferenceType() const { return nullptr; }
virtual const ArrayType *asArrayType() const { return nullptr; }
virtual const NamedType *asNamedType() const { return nullptr; }
virtual const Function *asFunctionType() const { return nullptr; }
virtual const Namespace *asNamespaceType() const { return nullptr; }
virtual const Template *asTemplateType() const { return nullptr; }
virtual const Class *asClassType() const { return nullptr; }
virtual const Enum *asEnumType() const { return nullptr; }
virtual const ForwardClassDeclaration *asForwardClassDeclarationType() const { return nullptr; }
virtual const ObjCClass *asObjCClassType() const { return nullptr; }
virtual const ObjCProtocol *asObjCProtocolType() const { return nullptr; }
virtual const ObjCMethod *asObjCMethodType() const { return nullptr; }
virtual const ObjCForwardClassDeclaration *asObjCForwardClassDeclarationType() const { return nullptr; }
virtual const ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclarationType() const { return nullptr; }
virtual UndefinedType *asUndefinedType() { return 0; }
virtual VoidType *asVoidType() { return 0; }
virtual IntegerType *asIntegerType() { return 0; }
virtual FloatType *asFloatType() { return 0; }
virtual PointerType *asPointerType() { return 0; }
virtual PointerToMemberType *asPointerToMemberType() { return 0; }
virtual ReferenceType *asReferenceType() { return 0; }
virtual ArrayType *asArrayType() { return 0; }
virtual NamedType *asNamedType() { return 0; }
virtual Function *asFunctionType() { return 0; }
virtual Namespace *asNamespaceType() { return 0; }
virtual Template *asTemplateType() { return 0; }
virtual Class *asClassType() { return 0; }
virtual Enum *asEnumType() { return 0; }
virtual ForwardClassDeclaration *asForwardClassDeclarationType() { return 0; }
virtual ObjCClass *asObjCClassType() { return 0; }
virtual ObjCProtocol *asObjCProtocolType() { return 0; }
virtual ObjCMethod *asObjCMethodType() { return 0; }
virtual ObjCForwardClassDeclaration *asObjCForwardClassDeclarationType() { return 0; }
virtual ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclarationType() { return 0; }
virtual UndefinedType *asUndefinedType() { return nullptr; }
virtual VoidType *asVoidType() { return nullptr; }
virtual IntegerType *asIntegerType() { return nullptr; }
virtual FloatType *asFloatType() { return nullptr; }
virtual PointerType *asPointerType() { return nullptr; }
virtual PointerToMemberType *asPointerToMemberType() { return nullptr; }
virtual ReferenceType *asReferenceType() { return nullptr; }
virtual ArrayType *asArrayType() { return nullptr; }
virtual NamedType *asNamedType() { return nullptr; }
virtual Function *asFunctionType() { return nullptr; }
virtual Namespace *asNamespaceType() { return nullptr; }
virtual Template *asTemplateType() { return nullptr; }
virtual Class *asClassType() { return nullptr; }
virtual Enum *asEnumType() { return nullptr; }
virtual ForwardClassDeclaration *asForwardClassDeclarationType() { return nullptr; }
virtual ObjCClass *asObjCClassType() { return nullptr; }
virtual ObjCProtocol *asObjCProtocolType() { return nullptr; }
virtual ObjCMethod *asObjCMethodType() { return nullptr; }
virtual ObjCForwardClassDeclaration *asObjCForwardClassDeclarationType() { return nullptr; }
virtual ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclarationType() { return nullptr; }
void accept(TypeVisitor *visitor);
static void accept(Type *type, TypeVisitor *visitor);
bool match(const Type *other, Matcher *matcher = 0) const;
bool match(const Type *other, Matcher *matcher = nullptr) const;
protected:
virtual void accept0(TypeVisitor *visitor) = 0;