From: Douglas Gregor Date: Wed, 28 Jan 2009 23:43:32 +0000 (+0000) Subject: Remove Expr::hasSideEffects. It doesn't work anyway X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54f0728c2ab0f967e976300478b2f5cdfed78415;p=clang Remove Expr::hasSideEffects. It doesn't work anyway git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63254 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index 861ac817cc..54c7640999 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -185,10 +185,6 @@ public: /// initializer, which can be emitted at compile-time. bool isConstantInitializer(ASTContext &Ctx) const; - /// @brief Determines whether this expression (or any of its - /// subexpressions) has side effects. - bool hasSideEffects(ASTContext &Ctx) const; - /// EvalResult is a struct with detailed info about an evaluated expression. struct EvalResult { /// Val - This is the scalar value the expression can be folded to. diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index ed73bfae27..d96f734bf4 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -758,12 +758,6 @@ bool Expr::isConstantInitializer(ASTContext &Ctx) const { return isEvaluatable(Ctx); } -bool Expr::hasSideEffects(ASTContext &Ctx) const { - EvalResult Result; - Evaluate(Result, Ctx); - return Result.HasSideEffects; -} - /// isIntegerConstantExpr - this recursive routine will test if an expression is /// an integer constant expression. Note: With the introduction of VLA's in /// C99 the result of the sizeof operator is no longer always a constant diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index a3c858d089..66b938ff07 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -845,7 +845,7 @@ InitListChecker::getStructuredSubobjectInit(InitListExpr *IList, unsigned Index, << InitRange; SemaRef->Diag(ExistingInit->getSourceRange().getBegin(), diag::note_previous_initializer) - << ExistingInit->hasSideEffects(SemaRef->Context) + << /*FIXME:has side effects=*/0 << ExistingInit->getSourceRange(); } @@ -882,7 +882,7 @@ void InitListChecker::UpdateStructuredListElement(InitListExpr *StructuredList, << expr->getSourceRange(); SemaRef->Diag(PrevInit->getSourceRange().getBegin(), diag::note_previous_initializer) - << (int)PrevInit->hasSideEffects(SemaRef->Context) + << /*FIXME:has side effects=*/0 << PrevInit->getSourceRange(); }