]> granicus.if.org Git - clang/commitdiff
Remove Expr::hasSideEffects. It doesn't work anyway
authorDouglas Gregor <dgregor@apple.com>
Wed, 28 Jan 2009 23:43:32 +0000 (23:43 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 28 Jan 2009 23:43:32 +0000 (23:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63254 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Expr.h
lib/AST/Expr.cpp
lib/Sema/SemaInit.cpp

index 861ac817ccac05e5a96c804acdb529ddbc6d7660..54c764099921c16f81b063c4ca824ab7a0343a86 100644 (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.
index ed73bfae27b29cd818fba02f97c025caf2e03a3c..d96f734bf41970dbd0bd59f898fcc0f99d80928a 100644 (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
index a3c858d0897d273739b0697ceefdc43191d3388a..66b938ff0713b8c42de9fafd8c031f2238677220 100644 (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();
   }