[cfe-commits] r62466 - in /cfe/trunk: include/clang/Parse/Ownership.h lib/Parse/AstGuard.h lib/Parse/ParseDecl.cpp lib/Parse/ParseInit.cpp lib/Parse/ParseObjc.cpp lib/Parse/ParseStmt.cpp lib/Parse/Parser.cpp
Sebastian Redl
sebastian.redl at getdesigned.at
Sun Jan 18 10:03:54 PST 2009
Author: cornedbee
Date: Sun Jan 18 12:03:53 2009
New Revision: 62466
URL: http://llvm.org/viewvc/llvm-project?rev=62466&view=rev
Log:
Rename move_convert to move_arg and move_res. The new names are less misleading (and shorter).
Modified:
cfe/trunk/include/clang/Parse/Ownership.h
cfe/trunk/lib/Parse/AstGuard.h
cfe/trunk/lib/Parse/ParseDecl.cpp
cfe/trunk/lib/Parse/ParseInit.cpp
cfe/trunk/lib/Parse/ParseObjc.cpp
cfe/trunk/lib/Parse/ParseStmt.cpp
cfe/trunk/lib/Parse/Parser.cpp
Modified: cfe/trunk/include/clang/Parse/Ownership.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Ownership.h?rev=62466&r1=62465&r2=62466&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Ownership.h (original)
+++ cfe/trunk/include/clang/Parse/Ownership.h Sun Jan 18 12:03:53 2009
@@ -99,7 +99,7 @@
// OwningResult object -> ResultMover -> OwningResult argument to
// OwningPtr(OwningResult) -> OwningPtr -> PtrMover -> final OwningPtr
// This conversion sequence is too complex to be allowed. Thus the special
-// move_convert functions, which help the compiler out with some explicit
+// move_* functions, which help the compiler out with some explicit
// conversions.
namespace clang
@@ -472,12 +472,12 @@
// These are necessary because of ambiguity problems.
template <ASTDestroyer Destroyer> inline
- ASTOwningPtr<Destroyer> move_convert(ASTOwningResult<Destroyer> &ptr) {
+ ASTOwningPtr<Destroyer> move_arg(ASTOwningResult<Destroyer> &ptr) {
return ASTOwningPtr<Destroyer>(ptr.ptr_move());
}
template <ASTDestroyer Destroyer> inline
- ASTOwningResult<Destroyer> move_convert(ASTOwningPtr<Destroyer> &ptr) {
+ ASTOwningResult<Destroyer> move_res(ASTOwningPtr<Destroyer> &ptr) {
return ASTOwningResult<Destroyer>(moving::ASTPtrMover<Destroyer>(ptr));
}
Modified: cfe/trunk/lib/Parse/AstGuard.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/AstGuard.h?rev=62466&r1=62465&r2=62466&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/AstGuard.h (original)
+++ cfe/trunk/lib/Parse/AstGuard.h Sun Jan 18 12:03:53 2009
@@ -61,7 +61,7 @@
typedef ASTVector<&Action::DeleteExpr, 12> ExprVector;
template <ASTDestroyer Destroyer, unsigned N> inline
- ASTMultiPtr<Destroyer> move_convert(ASTVector<Destroyer, N> &vec) {
+ ASTMultiPtr<Destroyer> move_arg(ASTVector<Destroyer, N> &vec) {
return ASTMultiPtr<Destroyer>(vec.getActions(), vec.take(), vec.size());
}
}
Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=62466&r1=62465&r2=62466&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Sun Jan 18 12:03:53 2009
@@ -312,7 +312,7 @@
SkipUntil(tok::semi);
return 0;
}
- Actions.AddInitializerToDecl(LastDeclInGroup, move_convert(Init));
+ Actions.AddInitializerToDecl(LastDeclInGroup, move_arg(Init));
} else if (Tok.is(tok::l_paren)) {
// Parse C++ direct initializer: '(' expression-list ')'
SourceLocation LParenLoc = ConsumeParen();
Modified: cfe/trunk/lib/Parse/ParseInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseInit.cpp?rev=62466&r1=62465&r2=62466&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseInit.cpp (original)
+++ cfe/trunk/lib/Parse/ParseInit.cpp Sun Jan 18 12:03:53 2009
@@ -170,7 +170,7 @@
return ParseAssignmentExprWithObjCMessageExprStart(StartLoc,
SourceLocation(),
- 0, move_convert(Idx));
+ 0, move_arg(Idx));
}
// Create designation if we haven't already.
Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=62466&r1=62465&r2=62466&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Sun Jan 18 12:03:53 2009
@@ -1202,7 +1202,7 @@
}
}
ConsumeToken(); // consume ';'
- return Actions.ActOnObjCAtThrowStmt(atLoc, move_convert(Res));
+ return Actions.ActOnObjCAtThrowStmt(atLoc, move_arg(Res));
}
/// objc-synchronized-statement:
@@ -1239,8 +1239,8 @@
BodyScope.Exit();
if (SynchBody.isInvalid())
SynchBody = Actions.ActOnNullStmt(Tok.getLocation());
- return Actions.ActOnObjCAtSynchronizedStmt(atLoc, move_convert(Res),
- move_convert(SynchBody));
+ return Actions.ActOnObjCAtSynchronizedStmt(atLoc, move_arg(Res),
+ move_arg(SynchBody));
}
/// objc-try-catch-statement:
@@ -1313,8 +1313,8 @@
if (CatchBody.isInvalid())
CatchBody = Actions.ActOnNullStmt(Tok.getLocation());
CatchStmts = Actions.ActOnObjCAtCatchStmt(AtCatchFinallyLoc,
- RParenLoc, move_convert(FirstPart), move_convert(CatchBody),
- move_convert(CatchStmts));
+ RParenLoc, move_arg(FirstPart), move_arg(CatchBody),
+ move_arg(CatchStmts));
} else {
Diag(AtCatchFinallyLoc, diag::err_expected_lparen_after)
<< "@catch clause";
@@ -1334,7 +1334,7 @@
if (FinallyBody.isInvalid())
FinallyBody = Actions.ActOnNullStmt(Tok.getLocation());
FinallyStmt = Actions.ActOnObjCAtFinallyStmt(AtCatchFinallyLoc,
- move_convert(FinallyBody));
+ move_arg(FinallyBody));
catch_or_finally_seen = true;
break;
}
@@ -1343,9 +1343,9 @@
Diag(atLoc, diag::err_missing_catch_finally);
return StmtError();
}
- return Actions.ActOnObjCAtTryStmt(atLoc, move_convert(TryBody),
- move_convert(CatchStmts),
- move_convert(FinallyStmt));
+ return Actions.ActOnObjCAtTryStmt(atLoc, move_arg(TryBody),
+ move_arg(CatchStmts),
+ move_arg(FinallyStmt));
}
/// objc-method-def: objc-method-proto ';'[opt] '{' body '}'
@@ -1387,7 +1387,7 @@
BodyScope.Exit();
// TODO: Pass argument information.
- Actions.ActOnFinishFunctionBody(MDecl, move_convert(FnBody));
+ Actions.ActOnFinishFunctionBody(MDecl, move_arg(FnBody));
return MDecl;
}
@@ -1408,7 +1408,7 @@
}
// Otherwise, eat the semicolon.
ExpectAndConsume(tok::semi, diag::err_expected_semi_after_expr);
- return Actions.ActOnExprStmt(move_convert(Res));
+ return Actions.ActOnExprStmt(move_arg(Res));
}
Parser::OwningExprResult Parser::ParseObjCAtExpression(SourceLocation AtLoc) {
@@ -1459,7 +1459,7 @@
}
return ParseObjCMessageExpressionBody(LBracLoc, SourceLocation(),
- 0, move_convert(Res));
+ 0, move_arg(Res));
}
/// ParseObjCMessageExpressionBody - Having parsed "'[' objc-receiver", parse
Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=62466&r1=62465&r2=62466&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Sun Jan 18 12:03:53 2009
@@ -118,7 +118,7 @@
}
// Otherwise, eat the semicolon.
ExpectAndConsume(tok::semi, diag::err_expected_semi_after_expr);
- return Actions.ActOnExprStmt(move_convert(Expr));
+ return Actions.ActOnExprStmt(move_arg(Expr));
}
case tok::kw_case: // C99 6.8.1: labeled-statement
@@ -217,7 +217,7 @@
return Actions.ActOnLabelStmt(IdentTok.getLocation(),
IdentTok.getIdentifierInfo(),
- ColonLoc, move_convert(SubStmt));
+ ColonLoc, move_arg(SubStmt));
}
/// ParseCaseStatement
@@ -271,9 +271,8 @@
if (SubStmt.isInvalid())
SubStmt = Actions.ActOnNullStmt(ColonLoc);
- return Actions.ActOnCaseStmt(CaseLoc, move_convert(LHS), DotDotDotLoc,
- move_convert(RHS), ColonLoc,
- move_convert(SubStmt));
+ return Actions.ActOnCaseStmt(CaseLoc, move_arg(LHS), DotDotDotLoc,
+ move_arg(RHS), ColonLoc, move_arg(SubStmt));
}
/// ParseDefaultStatement
@@ -304,7 +303,7 @@
return StmtError();
return Actions.ActOnDefaultStmt(DefaultLoc, ColonLoc,
- move_convert(SubStmt), CurScope);
+ move_arg(SubStmt), CurScope);
}
@@ -390,17 +389,17 @@
SkipUntil(tok::semi);
continue;
}
-
+
// Add the __extension__ node to the AST.
Res = Actions.ActOnUnaryOp(CurScope, ExtLoc, tok::kw___extension__,
Res.release());
if (Res.isInvalid())
continue;
-
+
// Eat the semicolon at the end of stmt and convert the expr into a
// statement.
ExpectAndConsume(tok::semi, diag::err_expected_semi_after_expr);
- R = Actions.ActOnExprStmt(move_convert(Res));
+ R = Actions.ActOnExprStmt(move_arg(Res));
}
}
@@ -415,7 +414,7 @@
}
SourceLocation RBraceLoc = ConsumeBrace();
- return Actions.ActOnCompoundStmt(LBraceLoc, RBraceLoc, move_convert(Stmts),
+ return Actions.ActOnCompoundStmt(LBraceLoc, RBraceLoc, move_arg(Stmts),
isStmtExpr);
}
@@ -575,9 +574,8 @@
if (ElseStmt.isInvalid())
ElseStmt = Actions.ActOnNullStmt(ElseStmtLoc);
- return Actions.ActOnIfStmt(IfLoc, move_convert(CondExp),
- move_convert(ThenStmt), ElseLoc,
- move_convert(ElseStmt));
+ return Actions.ActOnIfStmt(IfLoc, move_arg(CondExp), move_arg(ThenStmt),
+ ElseLoc, move_arg(ElseStmt));
}
/// ParseSwitchStatement
@@ -620,7 +618,7 @@
OwningStmtResult Switch(Actions);
if (!Cond.isInvalid())
- Switch = Actions.ActOnStartOfSwitchStmt(move_convert(Cond));
+ Switch = Actions.ActOnStartOfSwitchStmt(move_arg(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
@@ -652,8 +650,8 @@
if (Cond.isInvalid())
return StmtError();
- return Actions.ActOnFinishSwitchStmt(SwitchLoc, move_convert(Switch),
- move_convert(Body));
+ return Actions.ActOnFinishSwitchStmt(SwitchLoc, move_arg(Switch),
+ move_arg(Body));
}
/// ParseWhileStatement
@@ -722,8 +720,7 @@
if (Cond.isInvalid() || Body.isInvalid())
return StmtError();
- return Actions.ActOnWhileStmt(WhileLoc, move_convert(Cond),
- move_convert(Body));
+ return Actions.ActOnWhileStmt(WhileLoc, move_arg(Cond), move_arg(Body));
}
/// ParseDoStatement
@@ -787,8 +784,7 @@
if (Cond.isInvalid() || Body.isInvalid())
return StmtError();
- return Actions.ActOnDoStmt(DoLoc, move_convert(Body), WhileLoc,
- move_convert(Cond));
+ return Actions.ActOnDoStmt(DoLoc, move_arg(Body), WhileLoc, move_arg(Cond));
}
/// ParseForStatement
@@ -870,7 +866,7 @@
// Turn the expression into a stmt.
if (!Value.isInvalid())
- FirstPart = Actions.ActOnExprStmt(move_convert(Value));
+ FirstPart = Actions.ActOnExprStmt(move_arg(Value));
if (Tok.is(tok::semi)) {
ConsumeToken();
@@ -937,14 +933,14 @@
return StmtError();
if (!ForEach)
- return Actions.ActOnForStmt(ForLoc, LParenLoc, move_convert(FirstPart),
- move_convert(SecondPart), move_convert(ThirdPart),
- RParenLoc, move_convert(Body));
+ return Actions.ActOnForStmt(ForLoc, LParenLoc, move_arg(FirstPart),
+ move_arg(SecondPart), move_arg(ThirdPart),
+ RParenLoc, move_arg(Body));
else
return Actions.ActOnObjCForCollectionStmt(ForLoc, LParenLoc,
- move_convert(FirstPart),
- move_convert(SecondPart),
- RParenLoc, move_convert(Body));
+ move_arg(FirstPart),
+ move_arg(SecondPart),
+ RParenLoc, move_arg(Body));
}
/// ParseGotoStatement
@@ -972,7 +968,7 @@
SkipUntil(tok::semi, false, true);
return StmtError();
}
- Res = Actions.ActOnIndirectGotoStmt(GotoLoc, StarLoc, move_convert(R));
+ Res = Actions.ActOnIndirectGotoStmt(GotoLoc, StarLoc, move_arg(R));
} else {
Diag(Tok, diag::err_expected_ident);
return StmtError();
@@ -1018,7 +1014,7 @@
return StmtError();
}
}
- return Actions.ActOnReturnStmt(ReturnLoc, move_convert(R));
+ return Actions.ActOnReturnStmt(ReturnLoc, move_arg(R));
}
/// FuzzyParseMicrosoftAsmStatement. When -fms-extensions is enabled, this
@@ -1157,8 +1153,8 @@
return Actions.ActOnAsmStmt(AsmLoc, isSimple, isVolatile,
NumOutputs, NumInputs, &Names[0],
- move_convert(Constraints), move_convert(Exprs),
- move_convert(AsmString), move_convert(Clobbers),
+ move_arg(Constraints), move_arg(Exprs),
+ move_arg(AsmString), move_arg(Clobbers),
RParenLoc);
}
@@ -1243,7 +1239,7 @@
if (FnBody.isInvalid())
FnBody = Actions.ActOnCompoundStmt(L, R, MultiStmtArg(Actions), false);
- return Actions.ActOnFinishFunctionBody(Decl, move_convert(FnBody));
+ return Actions.ActOnFinishFunctionBody(Decl, move_arg(FnBody));
}
/// ParseCXXTryBlock - Parse a C++ try-block.
@@ -1277,8 +1273,8 @@
if (Handlers.empty())
return StmtError();
- return Actions.ActOnCXXTryBlock(TryLoc, move_convert(TryBlock),
- move_convert(Handlers));
+ return Actions.ActOnCXXTryBlock(TryLoc, move_arg(TryBlock),
+ move_arg(Handlers));
}
/// ParseCXXCatchBlock - Parse a C++ catch block, called handler in the standard
@@ -1329,6 +1325,5 @@
if (Block.isInvalid())
return move(Block);
- return Actions.ActOnCXXCatchBlock(CatchLoc, ExceptionDecl,
- move_convert(Block));
+ return Actions.ActOnCXXCatchBlock(CatchLoc, ExceptionDecl, move_arg(Block));
}
Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=62466&r1=62465&r2=62466&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Sun Jan 18 12:03:53 2009
@@ -357,8 +357,7 @@
"top-level asm block");
if (!Result.isInvalid())
- return Actions.ActOnFileScopeAsmDecl(Tok.getLocation(),
- move_convert(Result));
+ return Actions.ActOnFileScopeAsmDecl(Tok.getLocation(), move_arg(Result));
return 0;
}
case tok::at:
More information about the cfe-commits
mailing list