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

Anders Carlsson andersca at mac.com
Sat Apr 24 09:34:21 PDT 2010


Author: andersca
Date: Sat Apr 24 11:34:21 2010
New Revision: 102245

URL: http://llvm.org/viewvc/llvm-project?rev=102245&view=rev
Log:
Rename InheritancePath to BasePath, rename CastExpr::CXXBaseVector to CXXBaseSpecifierArray. More to come.

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

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=102245&r1=102244&r2=102245&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Sat Apr 24 11:34:21 2010
@@ -41,6 +41,9 @@
   class TemplateArgumentLoc;
   class TemplateArgumentListInfo;
 
+/// \brief A simple array of base specifiers.
+typedef UsuallyTinyPtrVector<const CXXBaseSpecifier> CXXBaseSpecifierArray;
+
 /// Expr - This represents one expression.  Note that Expr's are subclasses of
 /// Stmt.  This allows an expression to be transparently used any place a Stmt
 /// is required.
@@ -1552,8 +1555,6 @@
 /// classes).
 class CastExpr : public Expr {
 public:
-  typedef UsuallyTinyPtrVector<const CXXBaseSpecifier> CXXBaseVector;
-
   /// CastKind - the kind of cast this represents.
   enum CastKind {
     /// CK_Unknown - Unknown cast kind.
@@ -1649,12 +1650,12 @@
 private:
   CastKind Kind;
   Stmt *Op;
-  
-  /// InheritancePath - For derived-to-base and base-to-derived casts, the
-  /// base vector has the inheritance path.
-  CXXBaseVector *InheritancePath;
 
-  void CheckInheritancePath() const {
+  /// BasePath - For derived-to-base and base-to-derived casts, the base array
+  /// contains the inheritance path.
+  CXXBaseSpecifierArray *BasePath;
+
+  void CheckBasePath() const {
 #ifndef NDEBUG
     switch (getCastKind()) {
     // FIXME: We should add inheritance paths for these.
@@ -1686,7 +1687,7 @@
     case CK_MemberPointerToBoolean:
     case CK_AnyPointerToObjCPointerCast:
     case CK_AnyPointerToBlockPointerCast:
-      assert(!InheritancePath && "Cast kind has inheritance path!");
+      assert(!BasePath && "Cast kind shoudl not have a base path!");
       break;
     }
 #endif
@@ -1694,7 +1695,7 @@
 
 protected:
   CastExpr(StmtClass SC, QualType ty, const CastKind kind, Expr *op,
-           CXXBaseVector *path) :
+           CXXBaseSpecifierArray *BasePath) :
     Expr(SC, ty,
          // Cast expressions are type-dependent if the type is
          // dependent (C++ [temp.dep.expr]p3).
@@ -1702,8 +1703,8 @@
          // Cast expressions are value-dependent if the type is
          // dependent or if the subexpression is value-dependent.
          ty->isDependentType() || (op && op->isValueDependent())),
-    Kind(kind), Op(op), InheritancePath(path) {
-      CheckInheritancePath();
+    Kind(kind), Op(op), BasePath(BasePath) {
+      CheckBasePath();
     }
 
   /// \brief Construct an empty cast.
@@ -1768,8 +1769,9 @@
 
 public:
   ImplicitCastExpr(QualType ty, CastKind kind, Expr *op, 
-                   CXXBaseVector *path, bool Lvalue) :
-    CastExpr(ImplicitCastExprClass, ty, kind, op, path), LvalueCast(Lvalue) { }
+                   CXXBaseSpecifierArray *BasePath, bool Lvalue)
+    : CastExpr(ImplicitCastExprClass, ty, kind, op, BasePath), 
+    LvalueCast(Lvalue) { }
 
   /// \brief Construct an empty implicit cast.
   explicit ImplicitCastExpr(EmptyShell Shell)

Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=102245&r1=102244&r2=102245&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Sat Apr 24 11:34:21 2010
@@ -654,8 +654,8 @@
 
 void CastExpr::DoDestroy(ASTContext &C)
 {
-  if (InheritancePath)
-    InheritancePath->Destroy();
+  if (BasePath)
+    BasePath->Destroy();
   Expr::DoDestroy(C);
 }
 

Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=102245&r1=102244&r2=102245&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Sat Apr 24 11:34:21 2010
@@ -159,7 +159,7 @@
 /// If isLvalue, the result of the cast is an lvalue.
 void Sema::ImpCastExprToType(Expr *&Expr, QualType Ty,
                              CastExpr::CastKind Kind, 
-                             CastExpr::CXXBaseVector *InheritancePath,
+                             CXXBaseSpecifierArray *BasePath,
                              bool isLvalue) {
   QualType ExprTy = Context.getCanonicalType(Expr->getType());
   QualType TypeTy = Context.getCanonicalType(Ty);
@@ -180,15 +180,14 @@
 
   if (ImplicitCastExpr *ImpCast = dyn_cast<ImplicitCastExpr>(Expr)) {
     if (ImpCast->getCastKind() == Kind) {
-      assert(!InheritancePath && "FIXME: Merge paths!");
+      assert(!BasePath && "FIXME: Merge paths!");
       ImpCast->setType(Ty);
       ImpCast->setLvalueCast(isLvalue);
       return;
     }
   }
 
-  Expr = new (Context) ImplicitCastExpr(Ty, Kind, Expr, InheritancePath,
-                                        isLvalue);
+  Expr = new (Context) ImplicitCastExpr(Ty, Kind, Expr, BasePath, isLvalue);
 }
 
 void Sema::DeleteExpr(ExprTy *E) {

Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=102245&r1=102244&r2=102245&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Sat Apr 24 11:34:21 2010
@@ -3959,7 +3959,7 @@
   /// cast.  If there is already an implicit cast, merge into the existing one.
   /// If isLvalue, the result of the cast is an lvalue.
   void ImpCastExprToType(Expr *&Expr, QualType Type, CastExpr::CastKind Kind,
-                         CastExpr::CXXBaseVector *InheritancePath = 0,
+                         CXXBaseSpecifierArray *BasePath = 0,
                          bool isLvalue = false);
 
   // UsualUnaryConversions - promotes integers (C99 6.3.1.1p2) and converts





More information about the cfe-commits mailing list