Skip to content

Commit 2fe157d

Browse files
committed
Obsoleted all hand-written types for expressions.
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 657f894 commit 2fe157d

File tree

26 files changed

+64853
-63297
lines changed

26 files changed

+64853
-63297
lines changed

src/CppParser/AST.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -566,42 +566,42 @@ Friend::Friend() : CppSharp::CppParser::AST::Declaration(DeclarationKind::Friend
566566
Friend::~Friend() {}
567567

568568

569-
Statement::Statement(const std::string& str, StatementClass stmtClass, Declaration* decl) : string(str), _class(stmtClass), decl(decl) {}
569+
StatementObsolete::StatementObsolete(const std::string& str, StatementClassObsolete stmtClass, Declaration* decl) : string(str), _class(stmtClass), decl(decl) {}
570570

571-
Expression::Expression(const std::string& str, StatementClass stmtClass, Declaration* decl)
572-
: Statement(str, stmtClass, decl) {}
571+
ExpressionObsolete::ExpressionObsolete(const std::string& str, StatementClassObsolete stmtClass, Declaration* decl)
572+
: StatementObsolete(str, stmtClass, decl) {}
573573

574-
BinaryOperator::BinaryOperator(const std::string& str, Expression* lhs, Expression* rhs, const std::string& opcodeStr)
575-
: Expression(str, StatementClass::BinaryOperator), LHS(lhs), RHS(rhs), opcodeStr(opcodeStr) {}
574+
BinaryOperatorObsolete::BinaryOperatorObsolete(const std::string& str, ExpressionObsolete* lhs, ExpressionObsolete* rhs, const std::string& opcodeStr)
575+
: ExpressionObsolete(str, StatementClassObsolete::BinaryOperator), LHS(lhs), RHS(rhs), opcodeStr(opcodeStr) {}
576576

577-
BinaryOperator::~BinaryOperator()
577+
BinaryOperatorObsolete::~BinaryOperatorObsolete()
578578
{
579579
delete LHS;
580580
delete RHS;
581581
}
582582

583583

584-
CallExpr::CallExpr(const std::string& str, Declaration* decl)
585-
: Expression(str, StatementClass::CallExprClass, decl) {}
584+
CallExprObsolete::CallExprObsolete(const std::string& str, Declaration* decl)
585+
: ExpressionObsolete(str, StatementClassObsolete::CallExprClass, decl) {}
586586

587-
CallExpr::~CallExpr()
587+
CallExprObsolete::~CallExprObsolete()
588588
{
589589
for (auto& arg : Arguments)
590590
delete arg;
591591
}
592592

593-
DEF_VECTOR(CallExpr, Expression*, Arguments)
593+
DEF_VECTOR(CallExprObsolete, ExpressionObsolete*, Arguments)
594594

595-
CXXConstructExpr::CXXConstructExpr(const std::string& str, Declaration* decl)
596-
: Expression(str, StatementClass::CXXConstructExprClass, decl) {}
595+
CXXConstructExprObsolete::CXXConstructExprObsolete(const std::string& str, Declaration* decl)
596+
: ExpressionObsolete(str, StatementClassObsolete::CXXConstructExprClass, decl) {}
597597

598-
CXXConstructExpr::~CXXConstructExpr()
598+
CXXConstructExprObsolete::~CXXConstructExprObsolete()
599599
{
600600
for (auto& arg : Arguments)
601601
delete arg;
602602
}
603603

604-
DEF_VECTOR(CXXConstructExpr, Expression*, Arguments)
604+
DEF_VECTOR(CXXConstructExprObsolete, ExpressionObsolete*, Arguments)
605605

606606
Parameter::Parameter() : Declaration(DeclarationKind::Parameter),
607607
isIndirect(false), hasDefaultValue(false), defaultArgument(0) {}
@@ -613,14 +613,14 @@ Parameter::~Parameter()
613613
// HACK: see https://github.com/mono/CppSharp/issues/598
614614
switch (defaultArgument->_class)
615615
{
616-
case StatementClass::BinaryOperator:
617-
delete static_cast<BinaryOperator*>(defaultArgument);
616+
case StatementClassObsolete::BinaryOperator:
617+
delete static_cast<BinaryOperatorObsolete*>(defaultArgument);
618618
break;
619-
case StatementClass::CallExprClass:
620-
delete static_cast<CallExpr*>(defaultArgument);
619+
case StatementClassObsolete::CallExprClass:
620+
delete static_cast<CallExprObsolete*>(defaultArgument);
621621
break;
622-
case StatementClass::CXXConstructExprClass:
623-
delete static_cast<CXXConstructExpr*>(defaultArgument);
622+
case StatementClassObsolete::CXXConstructExprClass:
623+
delete static_cast<CXXConstructExprObsolete*>(defaultArgument);
624624
break;
625625
default:
626626
delete defaultArgument;

0 commit comments

Comments
 (0)