diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-01-18 18:53:16 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-01-18 18:53:16 +0000 |
commit | cd965b97cfac7b7a53a835810ec2bc2ac7a9dd1a (patch) | |
tree | b0877cb15978c0240797b11024005e522b665bd3 /lib/Parse | |
parent | f512e82f56671b695a32d019103e62a302838b7e (diff) |
Convert a few expression actions to smart pointers.
These actions are extremely widely used (identifier expressions and literals); still no performance regression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62468 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 2 | ||||
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 4 | ||||
-rw-r--r-- | lib/Parse/ParseExprCXX.cpp | 13 |
3 files changed, 9 insertions, 10 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 319c03eecf..456acbeebd 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -2105,7 +2105,7 @@ void Parser::ParseBracketDeclarator(Declarator &D) { } else if (Tok.getKind() == tok::numeric_constant && GetLookAheadToken(1).is(tok::r_square)) { // [4] is very common. Parse the numeric constant expression. - OwningExprResult ExprRes(Actions, Actions.ActOnNumericConstant(Tok)); + OwningExprResult ExprRes(Actions.ActOnNumericConstant(Tok)); ConsumeToken(); MatchRHSPunctuation(tok::r_square, StartLoc); diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 0295f70633..c8c521d6aa 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -1119,7 +1119,7 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, ExprType = SimpleExpr; if (!Result.isInvalid() && Tok.is(tok::r_paren)) Result = Actions.ActOnParenExpr(OpenLoc, Tok.getLocation(), - Result.release()); + move_arg(Result)); } // Match the ')'. @@ -1155,7 +1155,7 @@ Parser::OwningExprResult Parser::ParseStringLiteralExpression() { } while (isTokenStringLiteral()); // Pass the set of string tokens, ready for concatenation, to the actions. - return Owned(Actions.ActOnStringLiteral(&StringToks[0], StringToks.size())); + return Actions.ActOnStringLiteral(&StringToks[0], StringToks.size()); } /// ParseExpressionList - Used for C/C++ (argument-)expression-list. diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index d05c00292d..04e53a94ef 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -154,19 +154,18 @@ Parser::OwningExprResult Parser::ParseCXXIdExpression() { // Consume the identifier so that we can see if it is followed by a '('. IdentifierInfo &II = *Tok.getIdentifierInfo(); SourceLocation L = ConsumeToken(); - return Owned(Actions.ActOnIdentifierExpr(CurScope, L, II, - Tok.is(tok::l_paren), &SS)); + return Actions.ActOnIdentifierExpr(CurScope, L, II, + Tok.is(tok::l_paren), &SS); } case tok::kw_operator: { SourceLocation OperatorLoc = Tok.getLocation(); if (OverloadedOperatorKind Op = TryParseOperatorFunctionId()) - return Owned(Actions.ActOnCXXOperatorFunctionIdExpr( - CurScope, OperatorLoc, Op, Tok.is(tok::l_paren), SS)); + return Actions.ActOnCXXOperatorFunctionIdExpr( + CurScope, OperatorLoc, Op, Tok.is(tok::l_paren), SS); if (TypeTy *Type = ParseConversionFunctionId()) - return Owned(Actions.ActOnCXXConversionFunctionExpr(CurScope, OperatorLoc, - Type, - Tok.is(tok::l_paren), SS)); + return Actions.ActOnCXXConversionFunctionExpr(CurScope, OperatorLoc, Type, + Tok.is(tok::l_paren), SS); // We already complained about a bad conversion-function-id, // above. |