Kill FullExpr, as it was not, in fact, used anywhere in the code base.
authorJohn McCall <rjmccall@apple.com>
Tue, 7 Dec 2010 00:47:33 +0000 (00:47 +0000)
committerJohn McCall <rjmccall@apple.com>
Tue, 7 Dec 2010 00:47:33 +0000 (00:47 +0000)
I'm not opposed to the idea in concept, but there's no point in preserving
abortive experiments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121083 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/FullExpr.h [deleted file]
include/clang/AST/Stmt.h
include/clang/Sema/Sema.h
lib/AST/CMakeLists.txt
lib/AST/FullExpr.cpp [deleted file]
lib/Sema/SemaExprCXX.cpp

diff --git a/include/clang/AST/FullExpr.h b/include/clang/AST/FullExpr.h
deleted file mode 100644 (file)
index 6ceefed..0000000
+++ /dev/null
@@ -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
index 131853265335dac11c2b1f2284049c4e55889d91..421c59661b520c447eb43957a3a1b2e83f0a0597 100644 (file)
@@ -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>
index 8b157bdeb869fce093ab0ed4419689b089d8a638..56cf99ec79ed140c6177b56aafeee6368fd9cb4c 100644 (file)
@@ -78,7 +78,6 @@ namespace clang {
   class ExternalSemaSource;
   class FormatAttr;
   class FriendDecl;
-  class FullExpr;
   class FunctionDecl;
   class FunctionProtoType;
   class FunctionTemplateDecl;
@@ -1556,7 +1555,7 @@ public:
 
   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 @@ public:
                             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 @@ public:
   Expr *MaybeCreateExprWithCleanups(Expr *SubExpr);
   Stmt *MaybeCreateStmtWithCleanups(Stmt *SubStmt);
   ExprResult MaybeCreateExprWithCleanups(ExprResult SubExpr);
-  FullExpr CreateFullExpr(Expr *SubExpr);
 
   ExprResult ActOnFinishFullExpr(Expr *Expr);
   StmtResult ActOnFinishFullStmt(Stmt *Stmt);
index 6fca4d7e732dfaa2d81fa78f11a92bd2d8002c1e..e98a89646c34950008e02b2afad5b5067a9140b3 100644 (file)
@@ -24,7 +24,6 @@ add_clang_library(clangAST
   ExprClassification.cpp
   ExprConstant.cpp
   ExprCXX.cpp
-  FullExpr.cpp
   InheritViz.cpp
   ItaniumCXXABI.cpp
   MicrosoftCXXABI.cpp
diff --git a/lib/AST/FullExpr.cpp b/lib/AST/FullExpr.cpp
deleted file mode 100644 (file)
index 93ee8d1..0000000
+++ /dev/null
@@ -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;
-}
-
index 7be1c3307af404a8ca91228979e28e6883312415..fb5428a6b4a7df3693c9fb16286aaee93f089f0a 100644 (file)
@@ -3176,22 +3176,6 @@ Sema::MaybeCreateExprWithCleanups(ExprResult SubExpr) {
   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!");