Remove Expr::hasSideEffects. It doesn't work anyway

llvm-svn: 63254
This commit is contained in:
Douglas Gregor 2009-01-28 23:43:32 +00:00
parent 17bd094a6b
commit e6af7a028c
3 changed files with 2 additions and 12 deletions

View File

@ -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.

View File

@ -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

View File

@ -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();
}