[cfe-commits] r121083 - in /cfe/trunk: include/clang/AST/FullExpr.h include/clang/AST/Stmt.h include/clang/Sema/Sema.h lib/AST/CMakeLists.txt lib/AST/FullExpr.cpp lib/Sema/SemaExprCXX.cpp

John McCall rjmccall at apple.com
Mon Dec 6 16:47:33 PST 2010


Author: rjmccall
Date: Mon Dec  6 18:47:33 2010
New Revision: 121083

URL: http://llvm.org/viewvc/llvm-project?rev=121083&view=rev
Log:
Kill FullExpr, as it was not, in fact, used anywhere in the code base.
I'm not opposed to the idea in concept, but there's no point in preserving
abortive experiments.


Removed:
    cfe/trunk/include/clang/AST/FullExpr.h
    cfe/trunk/lib/AST/FullExpr.cpp
Modified:
    cfe/trunk/include/clang/AST/Stmt.h
    cfe/trunk/include/clang/Sema/Sema.h
    cfe/trunk/lib/AST/CMakeLists.txt
    cfe/trunk/lib/Sema/SemaExprCXX.cpp

Removed: cfe/trunk/include/clang/AST/FullExpr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/FullExpr.h?rev=121082&view=auto
==============================================================================
--- cfe/trunk/include/clang/AST/FullExpr.h (original)
+++ cfe/trunk/include/clang/AST/FullExpr.h (removed)
@@ -1,88 +0,0 @@
-//===--- FullExpr.h - C++ full expression class -----------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//  This file defines the FullExpr interface, to be used for type safe handling
-//  of full expressions.
-//
-//  Full expressions are described in C++ [intro.execution]p12.
-//
-//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_AST_FULLEXPR_H
-#define LLVM_CLANG_AST_FULLEXPR_H
-
-#include "llvm/ADT/PointerUnion.h"
-
-namespace clang {
-  class ASTContext;
-  class CXXTemporary;
-  class Expr;
-
-class FullExpr {
-  struct ExprAndTemporaries {
-    Expr *SubExpr;
-    
-    unsigned NumTemps;
-    
-    typedef CXXTemporary** temps_iterator;
-    
-    temps_iterator temps_begin() { 
-      return reinterpret_cast<CXXTemporary **>(this + 1); 
-    }
-    temps_iterator temps_end() { 
-      return temps_begin() + NumTemps;
-    }
-  };
-
-  typedef llvm::PointerUnion<Expr *, ExprAndTemporaries *> SubExprTy;
-  SubExprTy SubExpr;
-  
-  FullExpr() { }
-
-public:
-  static FullExpr Create(ASTContext &Context, Expr *SubExpr, 
-                         CXXTemporary **Temps, unsigned NumTemps);
-  
-  Expr *getExpr() {
-    if (Expr *E = SubExpr.dyn_cast<Expr *>())
-      return E;
-    
-    return SubExpr.get<ExprAndTemporaries *>()->SubExpr;
-  }
-  
-  const Expr *getExpr() const { 
-    return const_cast<FullExpr*>(this)->getExpr();
-  }
-  
-  typedef CXXTemporary** temps_iterator;
-
-  temps_iterator temps_begin() {
-    if (ExprAndTemporaries *ET = SubExpr.dyn_cast<ExprAndTemporaries *>())
-      return ET->temps_begin();
-    
-    return 0;
-  }
-  temps_iterator temps_end() {
-    if (ExprAndTemporaries *ET = SubExpr.dyn_cast<ExprAndTemporaries *>())
-      return ET->temps_end();
-    
-    return 0;
-  }
-    
-  void *getAsOpaquePtr() const { return SubExpr.getOpaqueValue(); }
-
-  static FullExpr getFromOpaquePtr(void *Ptr) {
-    FullExpr E;
-    E.SubExpr = SubExprTy::getFromOpaqueValue(Ptr);
-    return E;
-  }
-};
-
-}  // end namespace clang
-
-#endif

Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=121083&r1=121082&r2=121083&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Mon Dec  6 18:47:33 2010
@@ -20,7 +20,6 @@
 #include "clang/AST/PrettyPrinter.h"
 #include "clang/AST/StmtIterator.h"
 #include "clang/AST/DeclGroup.h"
-#include "clang/AST/FullExpr.h"
 #include "llvm/ADT/SmallVector.h"
 #include "clang/AST/ASTContext.h"
 #include <string>

Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=121083&r1=121082&r2=121083&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Mon Dec  6 18:47:33 2010
@@ -78,7 +78,6 @@
   class ExternalSemaSource;
   class FormatAttr;
   class FriendDecl;
-  class FullExpr;
   class FunctionDecl;
   class FunctionProtoType;
   class FunctionTemplateDecl;
@@ -1556,7 +1555,7 @@
 
   private:
     // FIXME: No need to make the entire Sema class a friend when it's just
-    // Sema::FullExpr that needs access to the constructor below.
+    // Sema::MakeFullExpr that needs access to the constructor below.
     friend class Sema;
 
     explicit FullExprArg(Expr *expr) : E(expr) {}
@@ -1595,17 +1594,17 @@
                             SourceLocation ColonLoc, Stmt *SubStmt,
                             bool HasUnusedAttr);
   StmtResult ActOnIfStmt(SourceLocation IfLoc,
-                                 FullExprArg CondVal, Decl *CondVar,
-                                 Stmt *ThenVal,
-                                 SourceLocation ElseLoc, Stmt *ElseVal);
+                         FullExprArg CondVal, Decl *CondVar,
+                         Stmt *ThenVal,
+                         SourceLocation ElseLoc, Stmt *ElseVal);
   StmtResult ActOnStartOfSwitchStmt(SourceLocation SwitchLoc,
                                             Expr *Cond,
                                             Decl *CondVar);
   StmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
                                            Stmt *Switch, Stmt *Body);
   StmtResult ActOnWhileStmt(SourceLocation WhileLoc,
-                                    FullExprArg Cond,
-                                    Decl *CondVar, Stmt *Body);
+                            FullExprArg Cond,
+                            Decl *CondVar, Stmt *Body);
   StmtResult ActOnDoStmt(SourceLocation DoLoc, Stmt *Body,
                                  SourceLocation WhileLoc,
                                  SourceLocation CondLParen, Expr *Cond,
@@ -2379,7 +2378,6 @@
   Expr *MaybeCreateExprWithCleanups(Expr *SubExpr);
   Stmt *MaybeCreateStmtWithCleanups(Stmt *SubStmt);
   ExprResult MaybeCreateExprWithCleanups(ExprResult SubExpr);
-  FullExpr CreateFullExpr(Expr *SubExpr);
 
   ExprResult ActOnFinishFullExpr(Expr *Expr);
   StmtResult ActOnFinishFullStmt(Stmt *Stmt);

Modified: cfe/trunk/lib/AST/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CMakeLists.txt?rev=121083&r1=121082&r2=121083&view=diff
==============================================================================
--- cfe/trunk/lib/AST/CMakeLists.txt (original)
+++ cfe/trunk/lib/AST/CMakeLists.txt Mon Dec  6 18:47:33 2010
@@ -24,7 +24,6 @@
   ExprClassification.cpp
   ExprConstant.cpp
   ExprCXX.cpp
-  FullExpr.cpp
   InheritViz.cpp
   ItaniumCXXABI.cpp
   MicrosoftCXXABI.cpp

Removed: cfe/trunk/lib/AST/FullExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/FullExpr.cpp?rev=121082&view=auto
==============================================================================
--- cfe/trunk/lib/AST/FullExpr.cpp (original)
+++ cfe/trunk/lib/AST/FullExpr.cpp (removed)
@@ -1,45 +0,0 @@
-//===--- FullExpr.cpp - C++ full expression class ---------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//  This file defines the FullExpr interface, to be used for type safe handling
-//  of full expressions.
-//
-//  Full expressions are described in C++ [intro.execution]p12.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/AST/ASTContext.h"
-#include "clang/AST/FullExpr.h"
-#include "clang/AST/Expr.h"
-#include "clang/AST/ExprCXX.h"
-#include "llvm/Support/AlignOf.h"
-using namespace clang;
-
-FullExpr FullExpr::Create(ASTContext &Context, Expr *SubExpr,
-                          CXXTemporary **Temporaries, unsigned NumTemporaries) {
-  FullExpr E;
-
-  if (!NumTemporaries) {
-      E.SubExpr = SubExpr;
-      return E;
-  }
-
-  unsigned Size = sizeof(FullExpr) 
-      + sizeof(CXXTemporary *) * NumTemporaries;
-
-  unsigned Align = llvm::AlignOf<ExprAndTemporaries>::Alignment;
-  ExprAndTemporaries *ET = 
-      static_cast<ExprAndTemporaries *>(Context.Allocate(Size, Align));
-
-  ET->SubExpr = SubExpr;
-  std::copy(Temporaries, Temporaries + NumTemporaries, ET->temps_begin());
-    
-  return E;
-}
-

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=121083&r1=121082&r2=121083&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Mon Dec  6 18:47:33 2010
@@ -3176,22 +3176,6 @@
   return Owned(MaybeCreateExprWithCleanups(SubExpr.take()));
 }
 
-FullExpr Sema::CreateFullExpr(Expr *SubExpr) {
-  unsigned FirstTemporary = ExprEvalContexts.back().NumTemporaries;
-  assert(ExprTemporaries.size() >= FirstTemporary);
-  
-  unsigned NumTemporaries = ExprTemporaries.size() - FirstTemporary;
-  CXXTemporary **Temporaries = 
-    NumTemporaries == 0 ? 0 : &ExprTemporaries[FirstTemporary];
-  
-  FullExpr E = FullExpr::Create(Context, SubExpr, Temporaries, NumTemporaries);
-
-  ExprTemporaries.erase(ExprTemporaries.begin() + FirstTemporary,
-                        ExprTemporaries.end());
-
-  return E;
-}
-
 Stmt *Sema::MaybeCreateStmtWithCleanups(Stmt *SubStmt) {
   assert(SubStmt && "sub statement can't be null!");
 





More information about the cfe-commits mailing list