forked from OSchip/llvm-project
Move a bunch of code out of the ComplexExprEvaluator class definition;
no functionality change. llvm-svn: 111207
This commit is contained in:
parent
a7c562d664
commit
c3e9df3cc0
|
|
@ -1989,7 +1989,27 @@ public:
|
|||
|
||||
bool VisitParenExpr(ParenExpr *E) { return Visit(E->getSubExpr()); }
|
||||
|
||||
bool VisitImaginaryLiteral(ImaginaryLiteral *E) {
|
||||
bool VisitImaginaryLiteral(ImaginaryLiteral *E);
|
||||
|
||||
bool VisitCastExpr(CastExpr *E);
|
||||
|
||||
bool VisitBinaryOperator(const BinaryOperator *E);
|
||||
bool VisitChooseExpr(const ChooseExpr *E)
|
||||
{ return Visit(E->getChosenSubExpr(Info.Ctx)); }
|
||||
bool VisitUnaryExtension(const UnaryOperator *E)
|
||||
{ return Visit(E->getSubExpr()); }
|
||||
// FIXME Missing: unary +/-/~, binary div, ImplicitValueInitExpr,
|
||||
// conditional ?:, comma
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
static bool EvaluateComplex(const Expr *E, ComplexValue &Result,
|
||||
EvalInfo &Info) {
|
||||
assert(E->getType()->isAnyComplexType());
|
||||
return ComplexExprEvaluator(Info, Result).Visit(const_cast<Expr*>(E));
|
||||
}
|
||||
|
||||
bool ComplexExprEvaluator::VisitImaginaryLiteral(ImaginaryLiteral *E) {
|
||||
Expr* SubExpr = E->getSubExpr();
|
||||
|
||||
if (SubExpr->getType()->isRealFloatingType()) {
|
||||
|
|
@ -2014,7 +2034,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
bool VisitCastExpr(CastExpr *E) {
|
||||
bool ComplexExprEvaluator::VisitCastExpr(CastExpr *E) {
|
||||
Expr* SubExpr = E->getSubExpr();
|
||||
QualType EltType = E->getType()->getAs<ComplexType>()->getElementType();
|
||||
QualType SubType = SubExpr->getType();
|
||||
|
|
@ -2107,22 +2127,6 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
bool VisitBinaryOperator(const BinaryOperator *E);
|
||||
bool VisitChooseExpr(const ChooseExpr *E)
|
||||
{ return Visit(E->getChosenSubExpr(Info.Ctx)); }
|
||||
bool VisitUnaryExtension(const UnaryOperator *E)
|
||||
{ return Visit(E->getSubExpr()); }
|
||||
// FIXME Missing: unary +/-/~, binary div, ImplicitValueInitExpr,
|
||||
// conditional ?:, comma
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
static bool EvaluateComplex(const Expr *E, ComplexValue &Result,
|
||||
EvalInfo &Info) {
|
||||
assert(E->getType()->isAnyComplexType());
|
||||
return ComplexExprEvaluator(Info, Result).Visit(const_cast<Expr*>(E));
|
||||
}
|
||||
|
||||
bool ComplexExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) {
|
||||
if (!Visit(E->getLHS()))
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue