Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/AST/Expr.cpp
Show First 20 Lines • Show All 3,571 Lines • ▼ Show 20 Lines | bool Expr::HasSideEffects(const ASTContext &Ctx, | ||||
for (const Stmt *SubStmt : children()) | for (const Stmt *SubStmt : children()) | ||||
if (SubStmt && | if (SubStmt && | ||||
cast<Expr>(SubStmt)->HasSideEffects(Ctx, IncludePossibleEffects)) | cast<Expr>(SubStmt)->HasSideEffects(Ctx, IncludePossibleEffects)) | ||||
return true; | return true; | ||||
return false; | return false; | ||||
} | } | ||||
FPOptions Expr::getFPFeaturesInEffect(const LangOptions &LO) const { | |||||
switch (getStmtClass()) { | |||||
case Stmt::UnaryOperatorClass: | |||||
return cast<UnaryOperator>(this)->getFPFeaturesInEffect(LO); | |||||
case Stmt::BinaryOperatorClass: | |||||
return cast<BinaryOperator>(this)->getFPFeaturesInEffect(LO); | |||||
case Stmt::CallExprClass: | |||||
return cast<CallExpr>(this)->getFPFeaturesInEffect(LO); | |||||
default: | |||||
if (CastExpr::classof(this)) | |||||
return cast<CastExpr>(this)->getFPFeaturesInEffect(LO); | |||||
} | |||||
return FPOptions::defaultWithoutTrailingStorage(LO); | |||||
} | |||||
namespace { | namespace { | ||||
/// Look for a call to a non-trivial function within an expression. | /// Look for a call to a non-trivial function within an expression. | ||||
class NonTrivialCallFinder : public ConstEvaluatedExprVisitor<NonTrivialCallFinder> | class NonTrivialCallFinder : public ConstEvaluatedExprVisitor<NonTrivialCallFinder> | ||||
{ | { | ||||
typedef ConstEvaluatedExprVisitor<NonTrivialCallFinder> Inherited; | typedef ConstEvaluatedExprVisitor<NonTrivialCallFinder> Inherited; | ||||
bool NonTrivial; | bool NonTrivial; | ||||
▲ Show 20 Lines • Show All 1,305 Lines • Show Last 20 Lines |