[cfe-commits] r58331 - in /cfe/trunk: Driver/RewriteObjC.cpp include/clang/AST/Expr.h include/clang/AST/StmtNodes.def lib/AST/Expr.cpp lib/AST/StmtPrinter.cpp lib/AST/StmtSerialization.cpp lib/Analysis/Environment.cpp lib/Analysis/GRExprEngine.cpp lib/Sema/SemaChecking.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaExpr.cpp
Douglas Gregor
doug.gregor at gmail.com
Tue Oct 28 08:36:24 PDT 2008
Author: dgregor
Date: Tue Oct 28 10:36:24 2008
New Revision: 58331
URL: http://llvm.org/viewvc/llvm-project?rev=58331&view=rev
Log:
Rename ExplicitCCastExpr to CStyleCastExpr
Modified:
cfe/trunk/Driver/RewriteObjC.cpp
cfe/trunk/include/clang/AST/Expr.h
cfe/trunk/include/clang/AST/StmtNodes.def
cfe/trunk/lib/AST/Expr.cpp
cfe/trunk/lib/AST/StmtPrinter.cpp
cfe/trunk/lib/AST/StmtSerialization.cpp
cfe/trunk/lib/Analysis/Environment.cpp
cfe/trunk/lib/Analysis/GRExprEngine.cpp
cfe/trunk/lib/Sema/SemaChecking.cpp
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
Modified: cfe/trunk/Driver/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteObjC.cpp?rev=58331&r1=58330&r2=58331&view=diff
==============================================================================
--- cfe/trunk/Driver/RewriteObjC.cpp (original)
+++ cfe/trunk/Driver/RewriteObjC.cpp Tue Oct 28 10:36:24 2008
@@ -1057,7 +1057,7 @@
SourceLocation(), II);
assert(RD && "RewriteObjCIvarRefExpr(): Can't find RecordDecl");
QualType castT = Context->getPointerType(Context->getTagDeclType(RD));
- CastExpr *castExpr = new ExplicitCCastExpr(castT, IV->getBase(), castT,
+ CastExpr *castExpr = new CStyleCastExpr(castT, IV->getBase(), castT,
SourceLocation());
// Don't forget the parens to enforce the proper binding.
ParenExpr *PE = new ParenExpr(IV->getBase()->getLocStart(),
@@ -1099,7 +1099,7 @@
SourceLocation(), II);
assert(RD && "RewriteObjCIvarRefExpr(): Can't find RecordDecl");
QualType castT = Context->getPointerType(Context->getTagDeclType(RD));
- CastExpr *castExpr = new ExplicitCCastExpr(castT, IV->getBase(), castT,
+ CastExpr *castExpr = new CStyleCastExpr(castT, IV->getBase(), castT,
SourceLocation());
// Don't forget the parens to enforce the proper binding.
ParenExpr *PE = new ParenExpr(IV->getBase()->getLocStart(),
@@ -1238,7 +1238,7 @@
}
}
- if (ExplicitCCastExpr *CE = dyn_cast<ExplicitCCastExpr>(S))
+ if (CStyleCastExpr *CE = dyn_cast<CStyleCastExpr>(S))
RewriteObjCQualifiedInterfaceTypes(CE);
if (isa<SwitchStmt>(S) || isa<WhileStmt>(S) ||
@@ -1560,7 +1560,7 @@
buf += " _rethrow = objc_exception_extract(&_stack);\n";
buf += " if (!_rethrow) objc_exception_try_exit(&_stack);\n";
buf += " objc_sync_exit(";
- Expr *syncExpr = new ExplicitCCastExpr(Context->getObjCIdType(),
+ Expr *syncExpr = new CStyleCastExpr(Context->getObjCIdType(),
S->getSynchExpr(),
Context->getObjCIdType(),
SourceLocation());
@@ -2189,7 +2189,7 @@
Context->getPointerType(DRE->getType()),
SourceLocation());
// cast to NSConstantString *
- CastExpr *cast = new ExplicitCCastExpr(Exp->getType(), Unop,
+ CastExpr *cast = new CStyleCastExpr(Exp->getType(), Unop,
Exp->getType(), SourceLocation());
ReplaceStmt(Exp, cast);
delete Exp;
@@ -2326,7 +2326,7 @@
ClsExprs.size());
// To turn off a warning, type-cast to 'id'
InitExprs.push_back( // set 'super class', using objc_getClass().
- new ExplicitCCastExpr(Context->getObjCIdType(),
+ new CStyleCastExpr(Context->getObjCIdType(),
Cls, Context->getObjCIdType(),
SourceLocation()));
// struct objc_super
@@ -2377,7 +2377,7 @@
llvm::SmallVector<Expr*, 4> InitExprs;
InitExprs.push_back(
- new ExplicitCCastExpr(Context->getObjCIdType(),
+ new CStyleCastExpr(Context->getObjCIdType(),
new DeclRefExpr(CurMethodDef->getSelfDecl(),
Context->getObjCIdType(),
SourceLocation()),
@@ -2396,7 +2396,7 @@
// To turn off a warning, type-cast to 'id'
InitExprs.push_back(
// set 'super class', using objc_getClass().
- new ExplicitCCastExpr(Context->getObjCIdType(),
+ new CStyleCastExpr(Context->getObjCIdType(),
Cls, Context->getObjCIdType(), SourceLocation()));
// struct objc_super
QualType superType = getSuperStructType();
@@ -2424,9 +2424,9 @@
} else {
// Remove all type-casts because it may contain objc-style types; e.g.
// Foo<Proto> *.
- while (ExplicitCCastExpr *CE = dyn_cast<ExplicitCCastExpr>(recExpr))
+ while (CStyleCastExpr *CE = dyn_cast<CStyleCastExpr>(recExpr))
recExpr = CE->getSubExpr();
- recExpr = new ExplicitCCastExpr(Context->getObjCIdType(), recExpr,
+ recExpr = new CStyleCastExpr(Context->getObjCIdType(), recExpr,
Context->getObjCIdType(),
SourceLocation());
MsgExprs.push_back(recExpr);
@@ -2452,14 +2452,14 @@
QualType type = ICE->getType()->isObjCQualifiedIdType()
? Context->getObjCIdType()
: ICE->getType();
- userExpr = new ExplicitCCastExpr(type, userExpr, type, SourceLocation());
+ userExpr = new CStyleCastExpr(type, userExpr, type, SourceLocation());
}
// Make id<P...> cast into an 'id' cast.
- else if (ExplicitCCastExpr *CE = dyn_cast<ExplicitCCastExpr>(userExpr)) {
+ else if (CStyleCastExpr *CE = dyn_cast<CStyleCastExpr>(userExpr)) {
if (CE->getType()->isObjCQualifiedIdType()) {
- while ((CE = dyn_cast<ExplicitCCastExpr>(userExpr)))
+ while ((CE = dyn_cast<CStyleCastExpr>(userExpr)))
userExpr = CE->getSubExpr();
- userExpr = new ExplicitCCastExpr(Context->getObjCIdType(),
+ userExpr = new CStyleCastExpr(Context->getObjCIdType(),
userExpr, Context->getObjCIdType(),
SourceLocation());
}
@@ -2504,7 +2504,7 @@
// If we don't do this cast, we get the following bizarre warning/note:
// xx.m:13: warning: function called through a non-compatible type
// xx.m:13: note: if this code is reached, the program will abort
- cast = new ExplicitCCastExpr(Context->getPointerType(Context->VoidTy), DRE,
+ cast = new CStyleCastExpr(Context->getPointerType(Context->VoidTy), DRE,
Context->getPointerType(Context->VoidTy),
SourceLocation());
@@ -2514,7 +2514,7 @@
// If we don't have a method decl, force a variadic cast.
Exp->getMethodDecl() ? Exp->getMethodDecl()->isVariadic() : true, 0);
castType = Context->getPointerType(castType);
- cast = new ExplicitCCastExpr(castType, cast, castType, SourceLocation());
+ cast = new CStyleCastExpr(castType, cast, castType, SourceLocation());
// Don't forget the parens to enforce the proper binding.
ParenExpr *PE = new ParenExpr(SourceLocation(), SourceLocation(), cast);
@@ -2533,7 +2533,7 @@
DeclRefExpr *STDRE = new DeclRefExpr(MsgSendStretFlavor, msgSendType,
SourceLocation());
// Need to cast objc_msgSend_stret to "void *" (see above comment).
- cast = new ExplicitCCastExpr(Context->getPointerType(Context->VoidTy), STDRE,
+ cast = new CStyleCastExpr(Context->getPointerType(Context->VoidTy), STDRE,
Context->getPointerType(Context->VoidTy),
SourceLocation());
// Now do the "normal" pointer to function cast.
@@ -2541,7 +2541,7 @@
&ArgTypes[0], ArgTypes.size(),
Exp->getMethodDecl() ? Exp->getMethodDecl()->isVariadic() : false, 0);
castType = Context->getPointerType(castType);
- cast = new ExplicitCCastExpr(castType, cast, castType, SourceLocation());
+ cast = new CStyleCastExpr(castType, cast, castType, SourceLocation());
// Don't forget the parens to enforce the proper binding.
PE = new ParenExpr(SourceLocation(), SourceLocation(), cast);
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=58331&r1=58330&r2=58331&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Tue Oct 28 10:36:24 2008
@@ -799,7 +799,7 @@
if (SC >= CXXNamedCastExprClass && SC <= CXXFunctionalCastExprClass)
return true;
- if (SC >= ImplicitCastExprClass && SC <= ExplicitCCastExprClass)
+ if (SC >= ImplicitCastExprClass && SC <= CStyleCastExprClass)
return true;
return false;
@@ -866,7 +866,7 @@
static bool classof(const Stmt *T) {
StmtClass SC = T->getStmtClass();
- if (SC >= ExplicitCastExprClass && SC <= ExplicitCCastExprClass)
+ if (SC >= ExplicitCastExprClass && SC <= CStyleCastExprClass)
return true;
if (SC >= CXXNamedCastExprClass && SC <= CXXFunctionalCastExprClass)
return true;
@@ -876,15 +876,15 @@
static bool classof(const ExplicitCastExpr *) { return true; }
};
-/// ExplicitCCastExpr - An explicit cast in C (C99 6.5.4) or a C-style
+/// CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style
/// cast in C++ (C++ [expr.cast]), which uses the syntax
/// (Type)expr. For example: @c (int)f.
-class ExplicitCCastExpr : public ExplicitCastExpr {
+class CStyleCastExpr : public ExplicitCastExpr {
SourceLocation Loc; // the location of the left paren
public:
- ExplicitCCastExpr(QualType exprTy, Expr *op, QualType writtenTy,
+ CStyleCastExpr(QualType exprTy, Expr *op, QualType writtenTy,
SourceLocation l) :
- ExplicitCastExpr(ExplicitCCastExprClass, exprTy, op, writtenTy), Loc(l) {}
+ ExplicitCastExpr(CStyleCastExprClass, exprTy, op, writtenTy), Loc(l) {}
SourceLocation getLParenLoc() const { return Loc; }
@@ -892,12 +892,12 @@
return SourceRange(Loc, getSubExpr()->getSourceRange().getEnd());
}
static bool classof(const Stmt *T) {
- return T->getStmtClass() == ExplicitCCastExprClass;
+ return T->getStmtClass() == CStyleCastExprClass;
}
- static bool classof(const ExplicitCCastExpr *) { return true; }
+ static bool classof(const CStyleCastExpr *) { return true; }
virtual void EmitImpl(llvm::Serializer& S) const;
- static ExplicitCCastExpr* CreateImpl(llvm::Deserializer& D, ASTContext& C);
+ static CStyleCastExpr* CreateImpl(llvm::Deserializer& D, ASTContext& C);
};
class BinaryOperator : public Expr {
Modified: cfe/trunk/include/clang/AST/StmtNodes.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtNodes.def?rev=58331&r1=58330&r2=58331&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/StmtNodes.def (original)
+++ cfe/trunk/include/clang/AST/StmtNodes.def Tue Oct 28 10:36:24 2008
@@ -77,7 +77,7 @@
STMT(48, ConditionalOperator , Expr)
STMT(49, ImplicitCastExpr , CastExpr)
STMT(50, ExplicitCastExpr , CastExpr)
-STMT(51, ExplicitCCastExpr , ExplicitCastExpr)
+STMT(51, CStyleCastExpr , ExplicitCastExpr)
STMT(52, CompoundLiteralExpr , Expr)
STMT(53, ExtVectorElementExpr , Expr)
STMT(54, InitListExpr , Expr)
Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=58331&r1=58330&r2=58331&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Tue Oct 28 10:36:24 2008
@@ -304,7 +304,7 @@
return E->hasLocalSideEffect();
return false;
}
- case ExplicitCCastExprClass:
+ case CStyleCastExprClass:
case CXXFunctionalCastExprClass:
// If this is a cast to void, check the operand. Otherwise, the result of
// the cast is unused.
@@ -427,7 +427,7 @@
return cast<CXXDefaultArgExpr>(this)->getExpr()->isLvalue(Ctx);
case CXXConditionDeclExprClass:
return LV_Valid;
- case ExplicitCCastExprClass:
+ case CStyleCastExprClass:
case CXXFunctionalCastExprClass:
case CXXStaticCastExprClass:
case CXXDynamicCastExprClass:
@@ -657,7 +657,7 @@
return true;
}
case ImplicitCastExprClass:
- case ExplicitCCastExprClass:
+ case CStyleCastExprClass:
case CXXFunctionalCastExprClass: {
const Expr *SubExpr = cast<CastExpr>(this)->getSubExpr();
SourceLocation CastLoc = getLocStart();
@@ -975,7 +975,7 @@
break;
}
case ImplicitCastExprClass:
- case ExplicitCCastExprClass:
+ case CStyleCastExprClass:
case CXXFunctionalCastExprClass: {
const Expr *SubExpr = cast<CastExpr>(this)->getSubExpr();
SourceLocation CastLoc = getLocStart();
Modified: cfe/trunk/lib/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=58331&r1=58330&r2=58331&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Tue Oct 28 10:36:24 2008
@@ -710,7 +710,7 @@
void StmtPrinter::VisitExplicitCastExpr(ExplicitCastExpr *) {
assert(0 && "ExplicitCastExpr is an abstract class");
}
-void StmtPrinter::VisitExplicitCCastExpr(ExplicitCCastExpr *Node) {
+void StmtPrinter::VisitCStyleCastExpr(CStyleCastExpr *Node) {
OS << "(" << Node->getType().getAsString() << ")";
PrintExpr(Node->getSubExpr());
}
Modified: cfe/trunk/lib/AST/StmtSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtSerialization.cpp?rev=58331&r1=58330&r2=58331&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtSerialization.cpp (original)
+++ cfe/trunk/lib/AST/StmtSerialization.cpp Tue Oct 28 10:36:24 2008
@@ -106,8 +106,8 @@
case ImplicitCastExprClass:
return ImplicitCastExpr::CreateImpl(D, C);
- case ExplicitCCastExprClass:
- return ExplicitCCastExpr::CreateImpl(D, C);
+ case CStyleCastExprClass:
+ return CStyleCastExpr::CreateImpl(D, C);
case IndirectGotoStmtClass:
return IndirectGotoStmt::CreateImpl(D, C);
@@ -376,19 +376,19 @@
return stmt;
}
-void ExplicitCCastExpr::EmitImpl(Serializer& S) const {
+void CStyleCastExpr::EmitImpl(Serializer& S) const {
S.Emit(getType());
S.Emit(getTypeAsWritten());
S.Emit(Loc);
S.EmitOwnedPtr(getSubExpr());
}
-ExplicitCCastExpr* ExplicitCCastExpr::CreateImpl(Deserializer& D, ASTContext& C) {
+CStyleCastExpr* CStyleCastExpr::CreateImpl(Deserializer& D, ASTContext& C) {
QualType t = QualType::ReadVal(D);
QualType writtenTy = QualType::ReadVal(D);
SourceLocation Loc = SourceLocation::ReadVal(D);
Expr* Op = D.ReadOwnedPtr<Expr>(C);
- return new ExplicitCCastExpr(t,Op,writtenTy,Loc);
+ return new CStyleCastExpr(t,Op,writtenTy,Loc);
}
void CharacterLiteral::EmitImpl(Serializer& S) const {
Modified: cfe/trunk/lib/Analysis/Environment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/Environment.cpp?rev=58331&r1=58330&r2=58331&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/Environment.cpp (original)
+++ cfe/trunk/lib/Analysis/Environment.cpp Tue Oct 28 10:36:24 2008
@@ -47,7 +47,7 @@
// subexpression that has a value.
case Stmt::ImplicitCastExprClass:
- case Stmt::ExplicitCCastExprClass: {
+ case Stmt::CStyleCastExprClass: {
CastExpr* C = cast<CastExpr>(E);
QualType CT = C->getType();
QualType ST = C->getSubExpr()->getType();
Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=58331&r1=58330&r2=58331&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Tue Oct 28 10:36:24 2008
@@ -345,7 +345,7 @@
break;
case Stmt::ImplicitCastExprClass:
- case Stmt::ExplicitCCastExprClass: {
+ case Stmt::CStyleCastExprClass: {
CastExpr* C = cast<CastExpr>(S);
VisitCast(C, C->getSubExpr(), Pred, Dst);
break;
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=58331&r1=58330&r2=58331&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Tue Oct 28 10:36:24 2008
@@ -826,7 +826,7 @@
// For casts, we need to handle conversions from arrays to
// pointer values, and pointer-to-pointer conversions.
case Stmt::ImplicitCastExprClass:
- case Stmt::ExplicitCCastExprClass:
+ case Stmt::CStyleCastExprClass:
case Stmt::CXXFunctionalCastExprClass: {
Expr* SubExpr = cast<CastExpr>(E)->getSubExpr();
QualType T = SubExpr->getType();
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=58331&r1=58330&r2=58331&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Oct 28 10:36:24 2008
@@ -1060,7 +1060,7 @@
CheckArithmeticConstantExpression(IExp);
}
case Expr::ImplicitCastExprClass:
- case Expr::ExplicitCCastExprClass: {
+ case Expr::CStyleCastExprClass: {
const Expr* SubExpr = cast<CastExpr>(Init)->getSubExpr();
if (Init->getStmtClass() == Expr::ImplicitCastExprClass) {
// Check for implicit promotion
@@ -1190,7 +1190,7 @@
// if we don't, we'll figure it out later
return 0;
}
- case Expr::ExplicitCCastExprClass: {
+ case Expr::CStyleCastExprClass: {
const Expr* SubExpr = cast<CastExpr>(E)->getSubExpr();
// Check for pointer->pointer cast
@@ -1310,7 +1310,7 @@
return true;
}
case Expr::ImplicitCastExprClass:
- case Expr::ExplicitCCastExprClass: {
+ case Expr::CStyleCastExprClass: {
const Expr *SubExpr = cast<CastExpr>(Init)->getSubExpr();
if (SubExpr->getType()->isArithmeticType())
return CheckArithmeticConstantExpression(SubExpr);
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=58331&r1=58330&r2=58331&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Oct 28 10:36:24 2008
@@ -1327,7 +1327,7 @@
if (CheckCastTypes(SourceRange(LParenLoc, RParenLoc), castType, castExpr))
return true;
- return new ExplicitCCastExpr(castType, castExpr, castType, LParenLoc);
+ return new CStyleCastExpr(castType, castExpr, castType, LParenLoc);
}
/// Note that lex is not null here, even if this is the gnu "x ?: y" extension.
More information about the cfe-commits
mailing list