[cfe-commits] r63254 - in /cfe/trunk: include/clang/AST/Expr.h lib/AST/Expr.cpp lib/Sema/SemaInit.cpp

Douglas Gregor dgregor at apple.com
Wed Jan 28 15:43:32 PST 2009


Author: dgregor
Date: Wed Jan 28 17:43:32 2009
New Revision: 63254

URL: http://llvm.org/viewvc/llvm-project?rev=63254&view=rev
Log:
Remove Expr::hasSideEffects. It doesn't work anyway

Modified:
    cfe/trunk/include/clang/AST/Expr.h
    cfe/trunk/lib/AST/Expr.cpp
    cfe/trunk/lib/Sema/SemaInit.cpp

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=63254&r1=63253&r2=63254&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Wed Jan 28 17:43:32 2009
@@ -185,10 +185,6 @@
   /// 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.

Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=63254&r1=63253&r2=63254&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Wed Jan 28 17:43:32 2009
@@ -758,12 +758,6 @@
   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

Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=63254&r1=63253&r2=63254&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Wed Jan 28 17:43:32 2009
@@ -845,7 +845,7 @@
       << 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 @@
       << expr->getSourceRange();
     SemaRef->Diag(PrevInit->getSourceRange().getBegin(), 
                   diag::note_previous_initializer)
-      << (int)PrevInit->hasSideEffects(SemaRef->Context)
+      << /*FIXME:has side effects=*/0
       << PrevInit->getSourceRange();
   }
   





More information about the cfe-commits mailing list