diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-01-11 00:38:46 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-01-11 00:38:46 +0000 |
commit | de307473448fb3cebcb4c10090728300b53bca03 (patch) | |
tree | bcc8cc86040e580d3fded69446e9cbf9b1ef48a8 /lib/Parse/ParseStmt.cpp | |
parent | 489034cf8bde09360e0089f401b2929597b125d8 (diff) |
Convert some more actions to smart pointers.
No performance regression in my basic test.
Also fixed a type error in ActOnFinishSwitchStmt's arguments (body is a stmt).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62032 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r-- | lib/Parse/ParseStmt.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index 9f525a5491..d83e98d8d8 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -215,9 +215,9 @@ Parser::OwningStmtResult Parser::ParseLabeledStatement() { if (SubStmt.isInvalid()) SubStmt = Actions.ActOnNullStmt(ColonLoc); - return Owned(Actions.ActOnLabelStmt(IdentTok.getLocation(), - IdentTok.getIdentifierInfo(), - ColonLoc, SubStmt.release())); + return Actions.ActOnLabelStmt(IdentTok.getLocation(), + IdentTok.getIdentifierInfo(), + ColonLoc, move_convert(SubStmt)); } /// ParseCaseStatement @@ -575,8 +575,9 @@ Parser::OwningStmtResult Parser::ParseIfStatement() { if (ElseStmt.isInvalid()) ElseStmt = Actions.ActOnNullStmt(ElseStmtLoc); - return Owned(Actions.ActOnIfStmt(IfLoc, CondExp.release(), ThenStmt.release(), - ElseLoc, ElseStmt.release())); + return Actions.ActOnIfStmt(IfLoc, move_convert(CondExp), + move_convert(ThenStmt), ElseLoc, + move_convert(ElseStmt)); } /// ParseSwitchStatement @@ -619,7 +620,7 @@ Parser::OwningStmtResult Parser::ParseSwitchStatement() { OwningStmtResult Switch(Actions); if (!Cond.isInvalid()) - Switch = Actions.ActOnStartOfSwitchStmt(Cond.release()); + Switch = Actions.ActOnStartOfSwitchStmt(move_convert(Cond)); // C99 6.8.4p3 - In C99, the body of the switch statement is a scope, even if // there is no compound stmt. C90 does not have this clause. We only do this @@ -650,9 +651,9 @@ Parser::OwningStmtResult Parser::ParseSwitchStatement() { if (Cond.isInvalid()) return StmtError(); - - return Owned(Actions.ActOnFinishSwitchStmt(SwitchLoc, Switch.release(), - Body.release())); + + return Actions.ActOnFinishSwitchStmt(SwitchLoc, move_convert(Switch), + move_convert(Body)); } /// ParseWhileStatement |