From: Steve Naroff Date: Sun, 16 Sep 2007 03:34:24 +0000 (+0000) Subject: Rename expression actions (from Parse-prefix to ActOn-prefix). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f69936d1ba843c2d3186e4aa2faa87c68e5bf2fb;p=clang Rename expression actions (from Parse-prefix to ActOn-prefix). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41997 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Parse/ParseExpr.cpp b/Parse/ParseExpr.cpp index 95c305ec08..e4e30638d1 100644 --- a/Parse/ParseExpr.cpp +++ b/Parse/ParseExpr.cpp @@ -269,7 +269,7 @@ ParseAssignmentExpressionWithLeadingStar(const Token &StarTok) { if (Res.isInvalid) return Res; // Combine StarTok + Res to get the new AST for the combined expression.. - Res = Actions.ParseUnaryOp(StarTok.getLocation(), tok::star, Res.Val); + Res = Actions.ActOnUnaryOp(StarTok.getLocation(), tok::star, Res.Val); if (Res.isInvalid) return Res; @@ -377,10 +377,10 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, unsigned MinPrec) { if (!LHS.isInvalid) { // Combine the LHS and RHS into the LHS (e.g. build AST). if (TernaryMiddle.isInvalid) - LHS = Actions.ParseBinOp(OpToken.getLocation(), OpToken.getKind(), + LHS = Actions.ActOnBinOp(OpToken.getLocation(), OpToken.getKind(), LHS.Val, RHS.Val); else - LHS = Actions.ParseConditionalOp(OpToken.getLocation(), ColonLoc, + LHS = Actions.ActOnConditionalOp(OpToken.getLocation(), ColonLoc, LHS.Val, TernaryMiddle.Val, RHS.Val); } else { // We had a semantic error on the LHS. Just free the RHS and continue. @@ -482,7 +482,7 @@ Parser::ExprResult Parser::ParseCastExpression(bool isUnaryExpression) { // TODO: For cast expression with CastTy. Res = ParseCastExpression(false); if (!Res.isInvalid) - Res = Actions.ParseCastExpr(LParenLoc, CastTy, RParenLoc, Res.Val); + Res = Actions.ActOnCastExpr(LParenLoc, CastTy, RParenLoc, Res.Val); return Res; } @@ -495,7 +495,7 @@ Parser::ExprResult Parser::ParseCastExpression(bool isUnaryExpression) { // constant: integer-constant // constant: floating-constant - Res = Actions.ParseNumericConstant(Tok); + Res = Actions.ActOnNumericConstant(Tok); ConsumeToken(); // These can be followed by postfix-expr pieces. @@ -519,14 +519,14 @@ Parser::ExprResult Parser::ParseCastExpression(bool isUnaryExpression) { return ParsePostfixExpressionSuffix(Res); } case tok::char_constant: // constant: character-constant - Res = Actions.ParseCharacterConstant(Tok); + Res = Actions.ActOnCharacterConstant(Tok); ConsumeToken(); // These can be followed by postfix-expr pieces. return ParsePostfixExpressionSuffix(Res); case tok::kw___func__: // primary-expression: __func__ [C99 6.4.2.2] case tok::kw___FUNCTION__: // primary-expression: __FUNCTION__ [GNU] case tok::kw___PRETTY_FUNCTION__: // primary-expression: __P..Y_F..N__ [GNU] - Res = Actions.ParsePreDefinedExpr(Tok.getLocation(), SavedKind); + Res = Actions.ActOnPreDefinedExpr(Tok.getLocation(), SavedKind); ConsumeToken(); // These can be followed by postfix-expr pieces. return ParsePostfixExpressionSuffix(Res); @@ -546,7 +546,7 @@ Parser::ExprResult Parser::ParseCastExpression(bool isUnaryExpression) { SourceLocation SavedLoc = ConsumeToken(); Res = ParseCastExpression(true); if (!Res.isInvalid) - Res = Actions.ParseUnaryOp(SavedLoc, SavedKind, Res.Val); + Res = Actions.ActOnUnaryOp(SavedLoc, SavedKind, Res.Val); return Res; } case tok::amp: // unary-expression: '&' cast-expression @@ -562,7 +562,7 @@ Parser::ExprResult Parser::ParseCastExpression(bool isUnaryExpression) { SourceLocation SavedLoc = ConsumeToken(); Res = ParseCastExpression(false); if (!Res.isInvalid) - Res = Actions.ParseUnaryOp(SavedLoc, SavedKind, Res.Val); + Res = Actions.ActOnUnaryOp(SavedLoc, SavedKind, Res.Val); return Res; } case tok::kw_sizeof: // unary-expression: 'sizeof' unary-expression @@ -635,7 +635,7 @@ Parser::ExprResult Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { SourceLocation RLoc = Tok.getLocation(); if (!LHS.isInvalid && !Idx.isInvalid && Tok.getKind() == tok::r_square) - LHS = Actions.ParseArraySubscriptExpr(LHS.Val, Loc, Idx.Val, RLoc); + LHS = Actions.ActOnArraySubscriptExpr(LHS.Val, Loc, Idx.Val, RLoc); else LHS = ExprResult(true); @@ -670,7 +670,7 @@ Parser::ExprResult Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { if (!LHS.isInvalid && Tok.getKind() == tok::r_paren) { assert((ArgExprs.size() == 0 || ArgExprs.size()-1 == CommaLocs.size())&& "Unexpected number of commas!"); - LHS = Actions.ParseCallExpr(LHS.Val, Loc, &ArgExprs[0], ArgExprs.size(), + LHS = Actions.ActOnCallExpr(LHS.Val, Loc, &ArgExprs[0], ArgExprs.size(), &CommaLocs[0], Tok.getLocation()); } @@ -688,7 +688,7 @@ Parser::ExprResult Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { } if (!LHS.isInvalid) - LHS = Actions.ParseMemberReferenceExpr(LHS.Val, OpLoc, OpKind, + LHS = Actions.ActOnMemberReferenceExpr(LHS.Val, OpLoc, OpKind, Tok.getLocation(), *Tok.getIdentifierInfo()); ConsumeToken(); @@ -697,7 +697,7 @@ Parser::ExprResult Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { case tok::plusplus: // postfix-expression: postfix-expression '++' case tok::minusminus: // postfix-expression: postfix-expression '--' if (!LHS.isInvalid) - LHS = Actions.ParsePostfixUnaryOp(Tok.getLocation(), Tok.getKind(), + LHS = Actions.ActOnPostfixUnaryOp(Tok.getLocation(), Tok.getKind(), LHS.Val); ConsumeToken(); break; @@ -736,7 +736,7 @@ Parser::ExprResult Parser::ParseSizeofAlignofExpression() { // If ParseParenExpression parsed a '(typename)' sequence only, the this is // sizeof/alignof a type. Otherwise, it is sizeof/alignof an expression. if (ExprType == CastExpr) { - return Actions.ParseSizeOfAlignOfTypeExpr(OpTok.getLocation(), + return Actions.ActOnSizeOfAlignOfTypeExpr(OpTok.getLocation(), OpTok.getKind() == tok::kw_sizeof, LParenLoc, CastTy, RParenLoc); } @@ -744,7 +744,7 @@ Parser::ExprResult Parser::ParseSizeofAlignofExpression() { // If we get here, the operand to the sizeof/alignof was an expresion. if (!Operand.isInvalid) - Operand = Actions.ParseUnaryOp(OpTok.getLocation(), OpTok.getKind(), + Operand = Actions.ActOnUnaryOp(OpTok.getLocation(), OpTok.getKind(), Operand.Val); return Operand; } @@ -955,7 +955,7 @@ Parser::ExprResult Parser::ParseParenExpression(ParenParseOption &ExprType, Result = ParseInitializer(); ExprType = CompoundLiteral; if (!Result.isInvalid) - return Actions.ParseCompoundLiteral(OpenLoc, Ty, RParenLoc, Result.Val); + return Actions.ActOnCompoundLiteral(OpenLoc, Ty, RParenLoc, Result.Val); } else if (ExprType == CastExpr) { // Note that this doesn't parse the subsequence cast-expression, it just // returns the parsed type to the callee. @@ -971,7 +971,7 @@ Parser::ExprResult Parser::ParseParenExpression(ParenParseOption &ExprType, Result = ParseExpression(); ExprType = SimpleExpr; if (!Result.isInvalid && Tok.getKind() == tok::r_paren) - Result = Actions.ParseParenExpr(OpenLoc, Tok.getLocation(), Result.Val); + Result = Actions.ActOnParenExpr(OpenLoc, Tok.getLocation(), Result.Val); } // Match the ')'. @@ -1006,5 +1006,5 @@ Parser::ExprResult Parser::ParseStringLiteralExpression() { } while (isTokenStringLiteral()); // Pass the set of string tokens, ready for concatenation, to the actions. - return Actions.ParseStringLiteral(&StringToks[0], StringToks.size()); + return Actions.ActOnStringLiteral(&StringToks[0], StringToks.size()); } diff --git a/Parse/ParseInit.cpp b/Parse/ParseInit.cpp index 0d443b5b54..6ba452a6e5 100644 --- a/Parse/ParseInit.cpp +++ b/Parse/ParseInit.cpp @@ -156,7 +156,7 @@ Parser::ExprResult Parser::ParseInitializer() { if (Tok.getKind() == tok::r_brace) { Diag(LBraceLoc, diag::ext_gnu_empty_initializer); // Match the '}'. - return Actions.ParseInitList(LBraceLoc, 0, 0, ConsumeBrace()); + return Actions.ActOnInitList(LBraceLoc, 0, 0, ConsumeBrace()); } llvm::SmallVector InitExprs; bool InitExprsOk = true; @@ -190,7 +190,7 @@ Parser::ExprResult Parser::ParseInitializer() { if (Tok.getKind() == tok::r_brace) break; } if (InitExprsOk && Tok.getKind() == tok::r_brace) - return Actions.ParseInitList(LBraceLoc, &InitExprs[0], InitExprs.size(), + return Actions.ActOnInitList(LBraceLoc, &InitExprs[0], InitExprs.size(), ConsumeBrace()); // Match the '}'. MatchRHSPunctuation(tok::r_brace, LBraceLoc); diff --git a/Parse/ParseStmt.cpp b/Parse/ParseStmt.cpp index 44caaf8c91..95008cdc80 100644 --- a/Parse/ParseStmt.cpp +++ b/Parse/ParseStmt.cpp @@ -420,7 +420,7 @@ Parser::StmtResult Parser::ParseCompoundStatementBody(bool isStmtExpr) { } // Add the __extension__ node to the AST. - Res = Actions.ParseUnaryOp(ExtLoc, tok::kw___extension__, Res.Val); + Res = Actions.ActOnUnaryOp(ExtLoc, tok::kw___extension__, Res.Val); if (Res.isInvalid) continue; diff --git a/Sema/Sema.h b/Sema/Sema.h index e304f07eea..900a913fd7 100644 --- a/Sema/Sema.h +++ b/Sema/Sema.h @@ -253,59 +253,59 @@ public: virtual ExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc, IdentifierInfo &II, bool HasTrailingLParen); - virtual ExprResult ParsePreDefinedExpr(SourceLocation Loc, + virtual ExprResult ActOnPreDefinedExpr(SourceLocation Loc, tok::TokenKind Kind); - virtual ExprResult ParseNumericConstant(const Token &); - virtual ExprResult ParseCharacterConstant(const Token &); - virtual ExprResult ParseParenExpr(SourceLocation L, SourceLocation R, + virtual ExprResult ActOnNumericConstant(const Token &); + virtual ExprResult ActOnCharacterConstant(const Token &); + virtual ExprResult ActOnParenExpr(SourceLocation L, SourceLocation R, ExprTy *Val); - /// ParseStringLiteral - The specified tokens were lexed as pasted string + /// ActOnStringLiteral - The specified tokens were lexed as pasted string /// fragments (e.g. "foo" "bar" L"baz"). - virtual ExprResult ParseStringLiteral(const Token *Toks, unsigned NumToks); + virtual ExprResult ActOnStringLiteral(const Token *Toks, unsigned NumToks); // Binary/Unary Operators. 'Tok' is the token for the operator. - virtual ExprResult ParseUnaryOp(SourceLocation OpLoc, tok::TokenKind Op, + virtual ExprResult ActOnUnaryOp(SourceLocation OpLoc, tok::TokenKind Op, ExprTy *Input); virtual ExprResult - ParseSizeOfAlignOfTypeExpr(SourceLocation OpLoc, bool isSizeof, + ActOnSizeOfAlignOfTypeExpr(SourceLocation OpLoc, bool isSizeof, SourceLocation LParenLoc, TypeTy *Ty, SourceLocation RParenLoc); - virtual ExprResult ParsePostfixUnaryOp(SourceLocation OpLoc, + virtual ExprResult ActOnPostfixUnaryOp(SourceLocation OpLoc, tok::TokenKind Kind, ExprTy *Input); - virtual ExprResult ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc, + virtual ExprResult ActOnArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc, ExprTy *Idx, SourceLocation RLoc); - virtual ExprResult ParseMemberReferenceExpr(ExprTy *Base,SourceLocation OpLoc, + virtual ExprResult ActOnMemberReferenceExpr(ExprTy *Base,SourceLocation OpLoc, tok::TokenKind OpKind, SourceLocation MemberLoc, IdentifierInfo &Member); - /// ParseCallExpr - Handle a call to Fn with the specified array of arguments. + /// ActOnCallExpr - Handle a call to Fn with the specified array of arguments. /// This provides the location of the left/right parens and a list of comma /// locations. - virtual ExprResult ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc, + virtual ExprResult ActOnCallExpr(ExprTy *Fn, SourceLocation LParenLoc, ExprTy **Args, unsigned NumArgs, SourceLocation *CommaLocs, SourceLocation RParenLoc); - virtual ExprResult ParseCastExpr(SourceLocation LParenLoc, TypeTy *Ty, + virtual ExprResult ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty, SourceLocation RParenLoc, ExprTy *Op); - virtual ExprResult ParseCompoundLiteral(SourceLocation LParenLoc, TypeTy *Ty, + virtual ExprResult ActOnCompoundLiteral(SourceLocation LParenLoc, TypeTy *Ty, SourceLocation RParenLoc, ExprTy *Op); - virtual ExprResult ParseInitList(SourceLocation LParenLoc, + virtual ExprResult ActOnInitList(SourceLocation LParenLoc, ExprTy **InitList, unsigned NumInit, SourceLocation RParenLoc); - virtual ExprResult ParseBinOp(SourceLocation TokLoc, tok::TokenKind Kind, + virtual ExprResult ActOnBinOp(SourceLocation TokLoc, tok::TokenKind Kind, ExprTy *LHS,ExprTy *RHS); - /// ParseConditionalOp - Parse a ?: operation. Note that 'LHS' may be null + /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null /// in the case of a the GNU conditional expr extension. - virtual ExprResult ParseConditionalOp(SourceLocation QuestionLoc, + virtual ExprResult ActOnConditionalOp(SourceLocation QuestionLoc, SourceLocation ColonLoc, ExprTy *Cond, ExprTy *LHS, ExprTy *RHS); @@ -405,7 +405,7 @@ private: // This routine is only used by the following two methods. C99 6.5.16. AssignmentCheckResult CheckAssignmentConstraints(QualType lhs, QualType rhs); - // CheckSingleAssignmentConstraints - Currently used by ParseCallExpr, + // CheckSingleAssignmentConstraints - Currently used by ActOnCallExpr, // CheckAssignmentOperands, and ParseReturnStmt. Prior to type checking, // this routine performs the default function/array converions. AssignmentCheckResult CheckSingleAssignmentConstraints(QualType lhs, @@ -423,7 +423,7 @@ private: /// the following "Check" methods will return a valid/converted QualType /// or a null QualType (indicating an error diagnostic was issued). - /// type checking binary operators (subroutines of ParseBinOp). + /// type checking binary operators (subroutines of ActOnBinOp). inline void InvalidOperands(SourceLocation l, Expr *&lex, Expr *&rex); inline QualType CheckVectorOperands(SourceLocation l, Expr *&lex, Expr *&rex); inline QualType CheckMultiplyDivideOperands( // C99 6.5.5 @@ -452,7 +452,7 @@ private: inline QualType CheckConditionalOperands( // C99 6.5.15 Expr *&cond, Expr *&lhs, Expr *&rhs, SourceLocation questionLoc); - /// type checking unary operators (subroutines of ParseUnaryOp). + /// type checking unary operators (subroutines of ActOnUnaryOp). /// C99 6.5.3.1, 6.5.3.2, 6.5.3.4 QualType CheckIncrementDecrementOperand(Expr *op, SourceLocation OpLoc); QualType CheckAddressOfOperand(Expr *op, SourceLocation OpLoc); diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp index bc107451d6..b08508b2d4 100644 --- a/Sema/SemaExpr.cpp +++ b/Sema/SemaExpr.cpp @@ -25,14 +25,14 @@ #include "llvm/ADT/StringExtras.h" using namespace clang; -/// ParseStringLiteral - The specified tokens were lexed as pasted string +/// ActOnStringLiteral - The specified tokens were lexed as pasted string /// fragments (e.g. "foo" "bar" L"baz"). The result string has to handle string /// concatenation ([C99 5.1.1.2, translation phase #6]), so it may come from /// multiple tokens. However, the common case is that StringToks points to one /// string. /// Action::ExprResult -Sema::ParseStringLiteral(const Token *StringToks, unsigned NumStringToks) { +Sema::ActOnStringLiteral(const Token *StringToks, unsigned NumStringToks) { assert(NumStringToks && "Must have at least one string!"); StringLiteralParser Literal(StringToks, NumStringToks, PP, Context.Target); @@ -87,7 +87,7 @@ Sema::ExprResult Sema::ActOnIdentifierExpr(Scope *S, SourceLocation Loc, abort(); } -Sema::ExprResult Sema::ParsePreDefinedExpr(SourceLocation Loc, +Sema::ExprResult Sema::ActOnPreDefinedExpr(SourceLocation Loc, tok::TokenKind Kind) { PreDefinedExpr::IdentType IT; @@ -109,7 +109,7 @@ Sema::ExprResult Sema::ParsePreDefinedExpr(SourceLocation Loc, return new PreDefinedExpr(Loc, Context.getPointerType(Context.CharTy), IT); } -Sema::ExprResult Sema::ParseCharacterConstant(const Token &Tok) { +Sema::ExprResult Sema::ActOnCharacterConstant(const Token &Tok) { llvm::SmallString<16> CharBuffer; CharBuffer.resize(Tok.getLength()); const char *ThisTokBegin = &CharBuffer[0]; @@ -123,7 +123,7 @@ Sema::ExprResult Sema::ParseCharacterConstant(const Token &Tok) { Tok.getLocation()); } -Action::ExprResult Sema::ParseNumericConstant(const Token &Tok) { +Action::ExprResult Sema::ActOnNumericConstant(const Token &Tok) { // fast path for a single digit (which is quite common). A single digit // cannot have a trigraph, escaped newline, radix prefix, or type suffix. if (Tok.getLength() == 1) { @@ -247,10 +247,10 @@ Action::ExprResult Sema::ParseNumericConstant(const Token &Tok) { return Res; } -Action::ExprResult Sema::ParseParenExpr(SourceLocation L, SourceLocation R, +Action::ExprResult Sema::ActOnParenExpr(SourceLocation L, SourceLocation R, ExprTy *Val) { Expr *e = (Expr *)Val; - assert((e != 0) && "ParseParenExpr() missing expr"); + assert((e != 0) && "ActOnParenExpr() missing expr"); return new ParenExpr(L, R, e); } @@ -275,7 +275,7 @@ QualType Sema::CheckSizeOfAlignOfOperand(QualType exprType, } Action::ExprResult Sema:: -ParseSizeOfAlignOfTypeExpr(SourceLocation OpLoc, bool isSizeof, +ActOnSizeOfAlignOfTypeExpr(SourceLocation OpLoc, bool isSizeof, SourceLocation LPLoc, TypeTy *Ty, SourceLocation RPLoc) { // If error parsing type, ignore. @@ -309,7 +309,7 @@ QualType Sema::CheckRealImagOperand(Expr *&V, SourceLocation Loc) { -Action::ExprResult Sema::ParsePostfixUnaryOp(SourceLocation OpLoc, +Action::ExprResult Sema::ActOnPostfixUnaryOp(SourceLocation OpLoc, tok::TokenKind Kind, ExprTy *Input) { UnaryOperator::Opcode Opc; @@ -325,7 +325,7 @@ Action::ExprResult Sema::ParsePostfixUnaryOp(SourceLocation OpLoc, } Action::ExprResult Sema:: -ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc, +ActOnArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc, ExprTy *Idx, SourceLocation RLoc) { Expr *LHSExp = static_cast(Base), *RHSExp = static_cast(Idx); @@ -449,7 +449,7 @@ CheckOCUVectorComponent(QualType baseType, SourceLocation OpLoc, } Action::ExprResult Sema:: -ParseMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc, +ActOnMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc, tok::TokenKind OpKind, SourceLocation MemberLoc, IdentifierInfo &Member) { Expr *BaseExpr = static_cast(Base); @@ -491,11 +491,11 @@ ParseMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc, SourceRange(MemberLoc)); } -/// ParseCallExpr - Handle a call to Fn with the specified array of arguments. +/// ActOnCallExpr - Handle a call to Fn with the specified array of arguments. /// This provides the location of the left/right parens and a list of comma /// locations. Action::ExprResult Sema:: -ParseCallExpr(ExprTy *fn, SourceLocation LParenLoc, +ActOnCallExpr(ExprTy *fn, SourceLocation LParenLoc, ExprTy **args, unsigned NumArgsInCall, SourceLocation *CommaLocs, SourceLocation RParenLoc) { Expr *Fn = static_cast(fn); @@ -542,7 +542,7 @@ ParseCallExpr(ExprTy *fn, SourceLocation LParenLoc, // Continue to check argument types (even if we have too few/many args). for (unsigned i = 0; i < NumArgsToCheck; i++) { Expr *argExpr = Args[i]; - assert(argExpr && "ParseCallExpr(): missing argument expression"); + assert(argExpr && "ActOnCallExpr(): missing argument expression"); QualType lhsType = proto->getArgType(i); QualType rhsType = argExpr->getType(); @@ -596,7 +596,7 @@ ParseCallExpr(ExprTy *fn, SourceLocation LParenLoc, // Promote the arguments (C99 6.5.2.2p7). for (unsigned i = NumArgsInProto; i < NumArgsInCall; i++) { Expr *argExpr = Args[i]; - assert(argExpr && "ParseCallExpr(): missing argument expression"); + assert(argExpr && "ActOnCallExpr(): missing argument expression"); DefaultArgumentPromotion(argExpr); if (Args[i] != argExpr) // The expression was converted. @@ -610,7 +610,7 @@ ParseCallExpr(ExprTy *fn, SourceLocation LParenLoc, // Promote the arguments (C99 6.5.2.2p6). for (unsigned i = 0; i < NumArgsInCall; i++) { Expr *argExpr = Args[i]; - assert(argExpr && "ParseCallExpr(): missing argument expression"); + assert(argExpr && "ActOnCallExpr(): missing argument expression"); DefaultArgumentPromotion(argExpr); if (Args[i] != argExpr) // The expression was converted. @@ -629,12 +629,12 @@ ParseCallExpr(ExprTy *fn, SourceLocation LParenLoc, } Action::ExprResult Sema:: -ParseCompoundLiteral(SourceLocation LParenLoc, TypeTy *Ty, +ActOnCompoundLiteral(SourceLocation LParenLoc, TypeTy *Ty, SourceLocation RParenLoc, ExprTy *InitExpr) { - assert((Ty != 0) && "ParseCompoundLiteral(): missing type"); + assert((Ty != 0) && "ActOnCompoundLiteral(): missing type"); QualType literalType = QualType::getFromOpaquePtr(Ty); // FIXME: put back this assert when initializers are worked out. - //assert((InitExpr != 0) && "ParseCompoundLiteral(): missing expression"); + //assert((InitExpr != 0) && "ActOnCompoundLiteral(): missing expression"); Expr *literalExpr = static_cast(InitExpr); // FIXME: add semantic analysis (C99 6.5.2.5). @@ -642,7 +642,7 @@ ParseCompoundLiteral(SourceLocation LParenLoc, TypeTy *Ty, } Action::ExprResult Sema:: -ParseInitList(SourceLocation LBraceLoc, ExprTy **initlist, unsigned NumInit, +ActOnInitList(SourceLocation LBraceLoc, ExprTy **initlist, unsigned NumInit, SourceLocation RBraceLoc) { Expr **InitList = reinterpret_cast(initlist); @@ -655,9 +655,9 @@ ParseInitList(SourceLocation LBraceLoc, ExprTy **initlist, unsigned NumInit, } Action::ExprResult Sema:: -ParseCastExpr(SourceLocation LParenLoc, TypeTy *Ty, +ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty, SourceLocation RParenLoc, ExprTy *Op) { - assert((Ty != 0) && (Op != 0) && "ParseCastExpr(): missing type or expr"); + assert((Ty != 0) && (Op != 0) && "ActOnCastExpr(): missing type or expr"); Expr *castExpr = static_cast(Op); QualType castType = QualType::getFromOpaquePtr(Ty); @@ -755,9 +755,9 @@ inline QualType Sema::CheckConditionalOperands( // C99 6.5.15 return QualType(); } -/// ParseConditionalOp - Parse a ?: operation. Note that 'LHS' may be null +/// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null /// in the case of a the GNU conditional expr extension. -Action::ExprResult Sema::ParseConditionalOp(SourceLocation QuestionLoc, +Action::ExprResult Sema::ActOnConditionalOp(SourceLocation QuestionLoc, SourceLocation ColonLoc, ExprTy *Cond, ExprTy *LHS, ExprTy *RHS) { @@ -1516,13 +1516,13 @@ static inline UnaryOperator::Opcode ConvertTokenKindToUnaryOpcode( } // Binary Operators. 'Tok' is the token for the operator. -Action::ExprResult Sema::ParseBinOp(SourceLocation TokLoc, tok::TokenKind Kind, +Action::ExprResult Sema::ActOnBinOp(SourceLocation TokLoc, tok::TokenKind Kind, ExprTy *LHS, ExprTy *RHS) { BinaryOperator::Opcode Opc = ConvertTokenKindToBinaryOpcode(Kind); Expr *lhs = (Expr *)LHS, *rhs = (Expr*)RHS; - assert((lhs != 0) && "ParseBinOp(): missing left expression"); - assert((rhs != 0) && "ParseBinOp(): missing right expression"); + assert((lhs != 0) && "ActOnBinOp(): missing left expression"); + assert((rhs != 0) && "ActOnBinOp(): missing right expression"); QualType ResultTy; // Result type of the binary operator. QualType CompTy; // Computation type for compound assignments (e.g. '+=') @@ -1616,7 +1616,7 @@ Action::ExprResult Sema::ParseBinOp(SourceLocation TokLoc, tok::TokenKind Kind, } // Unary Operators. 'Tok' is the token for the operator. -Action::ExprResult Sema::ParseUnaryOp(SourceLocation OpLoc, tok::TokenKind Op, +Action::ExprResult Sema::ActOnUnaryOp(SourceLocation OpLoc, tok::TokenKind Op, ExprTy *input) { Expr *Input = (Expr*)input; UnaryOperator::Opcode Opc = ConvertTokenKindToUnaryOpcode(Op); diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h index ee11b68444..5d5333cdcf 100644 --- a/include/clang/Parse/Action.h +++ b/include/clang/Parse/Action.h @@ -297,45 +297,45 @@ public: return 0; } - virtual ExprResult ParsePreDefinedExpr(SourceLocation Loc, + virtual ExprResult ActOnPreDefinedExpr(SourceLocation Loc, tok::TokenKind Kind) { return 0; } - virtual ExprResult ParseCharacterConstant(const Token &) { return 0; } - virtual ExprResult ParseNumericConstant(const Token &) { return 0; } + virtual ExprResult ActOnCharacterConstant(const Token &) { return 0; } + virtual ExprResult ActOnNumericConstant(const Token &) { return 0; } - /// ParseStringLiteral - The specified tokens were lexed as pasted string + /// ActOnStringLiteral - The specified tokens were lexed as pasted string /// fragments (e.g. "foo" "bar" L"baz"). - virtual ExprResult ParseStringLiteral(const Token *Toks, unsigned NumToks) { + virtual ExprResult ActOnStringLiteral(const Token *Toks, unsigned NumToks) { return 0; } - virtual ExprResult ParseParenExpr(SourceLocation L, SourceLocation R, + virtual ExprResult ActOnParenExpr(SourceLocation L, SourceLocation R, ExprTy *Val) { return Val; // Default impl returns operand. } // Postfix Expressions. - virtual ExprResult ParsePostfixUnaryOp(SourceLocation OpLoc, + virtual ExprResult ActOnPostfixUnaryOp(SourceLocation OpLoc, tok::TokenKind Kind, ExprTy *Input) { return 0; } - virtual ExprResult ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc, + virtual ExprResult ActOnArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc, ExprTy *Idx, SourceLocation RLoc) { return 0; } - virtual ExprResult ParseMemberReferenceExpr(ExprTy *Base,SourceLocation OpLoc, + virtual ExprResult ActOnMemberReferenceExpr(ExprTy *Base,SourceLocation OpLoc, tok::TokenKind OpKind, SourceLocation MemberLoc, IdentifierInfo &Member) { return 0; } - /// ParseCallExpr - Handle a call to Fn with the specified array of arguments. + /// ActOnCallExpr - Handle a call to Fn with the specified array of arguments. /// This provides the location of the left/right parens and a list of comma /// locations. There are guaranteed to be one fewer commas than arguments, /// unless there are zero arguments. - virtual ExprResult ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc, + virtual ExprResult ActOnCallExpr(ExprTy *Fn, SourceLocation LParenLoc, ExprTy **Args, unsigned NumArgs, SourceLocation *CommaLocs, SourceLocation RParenLoc) { @@ -343,39 +343,39 @@ public: } // Unary Operators. 'Tok' is the token for the operator. - virtual ExprResult ParseUnaryOp(SourceLocation OpLoc, tok::TokenKind Op, + virtual ExprResult ActOnUnaryOp(SourceLocation OpLoc, tok::TokenKind Op, ExprTy *Input) { return 0; } virtual ExprResult - ParseSizeOfAlignOfTypeExpr(SourceLocation OpLoc, bool isSizeof, + ActOnSizeOfAlignOfTypeExpr(SourceLocation OpLoc, bool isSizeof, SourceLocation LParenLoc, TypeTy *Ty, SourceLocation RParenLoc) { return 0; } - virtual ExprResult ParseCompoundLiteral(SourceLocation LParen, TypeTy *Ty, + virtual ExprResult ActOnCompoundLiteral(SourceLocation LParen, TypeTy *Ty, SourceLocation RParen, ExprTy *Op) { return 0; } - virtual ExprResult ParseInitList(SourceLocation LParenLoc, + virtual ExprResult ActOnInitList(SourceLocation LParenLoc, ExprTy **InitList, unsigned NumInit, SourceLocation RParenLoc) { return 0; } - virtual ExprResult ParseCastExpr(SourceLocation LParenLoc, TypeTy *Ty, + virtual ExprResult ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty, SourceLocation RParenLoc, ExprTy *Op) { return 0; } - virtual ExprResult ParseBinOp(SourceLocation TokLoc, tok::TokenKind Kind, + virtual ExprResult ActOnBinOp(SourceLocation TokLoc, tok::TokenKind Kind, ExprTy *LHS, ExprTy *RHS) { return 0; } - /// ParseConditionalOp - Parse a ?: operation. Note that 'LHS' may be null + /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null /// in the case of a the GNU conditional expr extension. - virtual ExprResult ParseConditionalOp(SourceLocation QuestionLoc, + virtual ExprResult ActOnConditionalOp(SourceLocation QuestionLoc, SourceLocation ColonLoc, ExprTy *Cond, ExprTy *LHS, ExprTy *RHS){ return 0;