summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Parse')
-rw-r--r--clang/lib/Parse/ParseCXXInlineMethods.cpp4
-rw-r--r--clang/lib/Parse/ParseDecl.cpp28
-rw-r--r--clang/lib/Parse/ParseDeclCXX.cpp18
-rw-r--r--clang/lib/Parse/ParseExpr.cpp60
-rw-r--r--clang/lib/Parse/ParseExprCXX.cpp26
-rw-r--r--clang/lib/Parse/ParseInit.cpp12
-rw-r--r--clang/lib/Parse/ParseObjc.cpp48
-rw-r--r--clang/lib/Parse/ParseOpenMP.cpp12
-rw-r--r--clang/lib/Parse/ParseStmt.cpp64
-rw-r--r--clang/lib/Parse/ParseTemplate.cpp4
10 files changed, 138 insertions, 138 deletions
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp
index 19aa664031d..310e2b4cd8a 100644
--- a/clang/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/clang/lib/Parse/ParseCXXInlineMethods.cpp
@@ -349,7 +349,7 @@ void Parser::ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM) {
(*Toks)[Toks->size() - 3].getLocation());
}
Actions.ActOnParamDefaultArgument(LM.DefaultArgs[I].Param, EqualLoc,
- DefArgResult.take());
+ DefArgResult.get());
}
assert(!PP.getSourceManager().isBeforeInTranslationUnit(origLoc,
@@ -535,7 +535,7 @@ void Parser::ParseLexedMemberInitializer(LateParsedMemberInitializer &MI) {
EqualLoc);
Actions.ActOnFinishCXXInClassMemberInitializer(MI.Field, EqualLoc,
- Init.release());
+ Init.get());
// The next token should be our artificial terminating EOF token.
if (Tok.isNot(tok::eof)) {
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 7507ddf49c9..53851929a0c 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -304,7 +304,7 @@ unsigned Parser::ParseAttributeArgsCommon(
SkipUntil(tok::r_paren, StopAtSemi);
return 0;
}
- ArgExprs.push_back(ArgExpr.release());
+ ArgExprs.push_back(ArgExpr.get());
// Eat the comma, move to the next argument
} while (TryConsumeToken(tok::comma));
}
@@ -906,7 +906,7 @@ void Parser::ParseAvailabilityAttribute(IdentifierInfo &Availability,
Changes[Introduced],
Changes[Deprecated],
Changes[Obsoleted],
- UnavailableLoc, MessageExpr.take(),
+ UnavailableLoc, MessageExpr.get(),
AttributeList::AS_GNU);
}
@@ -1187,7 +1187,7 @@ void Parser::ParseTypeTagForDatatypeAttribute(IdentifierInfo &AttrName,
if (!T.consumeClose()) {
Attrs.addNewTypeTagForDatatype(&AttrName, AttrNameLoc, nullptr, AttrNameLoc,
- ArgumentKind, MatchingCType.release(),
+ ArgumentKind, MatchingCType.get(),
LayoutCompatible, MustBeNull,
AttributeList::AS_GNU);
}
@@ -1699,7 +1699,7 @@ bool Parser::ParseAsmAttributesAfterDeclarator(Declarator &D) {
return true;
}
- D.setAsmLabel(AsmLabel.release());
+ D.setAsmLabel(AsmLabel.get());
D.SetRangeEnd(Loc);
}
@@ -1857,7 +1857,7 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(
SkipUntil(StopTokens, StopAtSemi | StopBeforeMatch);
Actions.ActOnInitializerError(ThisDecl);
} else
- Actions.AddInitializerToDecl(ThisDecl, Init.take(),
+ Actions.AddInitializerToDecl(ThisDecl, Init.get(),
/*DirectInit=*/false, TypeContainsAuto);
}
} else if (Tok.is(tok::l_paren)) {
@@ -1896,7 +1896,7 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(
ExprResult Initializer = Actions.ActOnParenListExpr(T.getOpenLocation(),
T.getCloseLocation(),
Exprs);
- Actions.AddInitializerToDecl(ThisDecl, Initializer.take(),
+ Actions.AddInitializerToDecl(ThisDecl, Initializer.get(),
/*DirectInit=*/true, TypeContainsAuto);
}
} else if (getLangOpts().CPlusPlus11 && Tok.is(tok::l_brace) &&
@@ -1919,7 +1919,7 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(
if (Init.isInvalid()) {
Actions.ActOnInitializerError(ThisDecl);
} else
- Actions.AddInitializerToDecl(ThisDecl, Init.take(),
+ Actions.AddInitializerToDecl(ThisDecl, Init.get(),
/*DirectInit=*/true, TypeContainsAuto);
} else {
@@ -2294,7 +2294,7 @@ void Parser::ParseAlignmentSpecifier(ParsedAttributes &Attrs,
*EndLoc = T.getCloseLocation();
ArgsVector ArgExprs;
- ArgExprs.push_back(ArgExpr.release());
+ ArgExprs.push_back(ArgExpr.get());
Attrs.addNew(KWName, KWLoc, nullptr, KWLoc, ArgExprs.data(), 1,
AttributeList::AS_Keyword, EllipsisLoc);
}
@@ -3261,7 +3261,7 @@ ParseStructDeclaration(ParsingDeclSpec &DS, FieldCallback &Fields) {
if (Res.isInvalid())
SkipUntil(tok::semi, StopBeforeMatch);
else
- DeclaratorInfo.BitfieldSize = Res.release();
+ DeclaratorInfo.BitfieldSize = Res.get();
}
// If attributes exist after the declarator, parse them.
@@ -3817,7 +3817,7 @@ void Parser::ParseEnumBody(SourceLocation StartLoc, Decl *EnumDecl) {
LastEnumConstDecl,
IdentLoc, Ident,
attrs.getList(), EqualLoc,
- AssignedVal.release());
+ AssignedVal.get());
PD.complete(EnumConstDecl);
EnumConstantDecls.push_back(EnumConstDecl);
@@ -5435,7 +5435,7 @@ void Parser::ParseParameterDeclarationClause(
} else {
// Inform the actions module about the default argument
Actions.ActOnParamDefaultArgument(Param, EqualLoc,
- DefArgResult.take());
+ DefArgResult.get());
}
}
}
@@ -5497,7 +5497,7 @@ void Parser::ParseBracketDeclarator(Declarator &D) {
// Remember that we parsed a array type, and remember its features.
D.AddTypeInfo(DeclaratorChunk::getArray(0, false, false,
- ExprRes.release(),
+ ExprRes.get(),
T.getOpenLocation(),
T.getCloseLocation()),
attrs, T.getCloseLocation());
@@ -5567,7 +5567,7 @@ void Parser::ParseBracketDeclarator(Declarator &D) {
// Remember that we parsed a array type, and remember its features.
D.AddTypeInfo(DeclaratorChunk::getArray(DS.getTypeQualifiers(),
StaticLoc.isValid(), isStar,
- NumElements.release(),
+ NumElements.get(),
T.getOpenLocation(),
T.getCloseLocation()),
attrs, T.getCloseLocation());
@@ -5670,7 +5670,7 @@ void Parser::ParseAtomicSpecifier(DeclSpec &DS) {
const char *PrevSpec = nullptr;
unsigned DiagID;
if (DS.SetTypeSpecType(DeclSpec::TST_atomic, StartLoc, PrevSpec,
- DiagID, Result.release(),
+ DiagID, Result.get(),
Actions.getASTContext().getPrintingPolicy()))
Diag(StartLoc, DiagID) << PrevSpec;
}
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp
index 91ca58d55ce..ab4dfd01b1f 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -289,7 +289,7 @@ Decl *Parser::ParseLinkage(ParsingDeclSpec &DS, unsigned Context) {
Lang.isInvalid()
? nullptr
: Actions.ActOnStartLinkageSpecification(
- getCurScope(), DS.getSourceRange().getBegin(), Lang.take(),
+ getCurScope(), DS.getSourceRange().getBegin(), Lang.get(),
Tok.is(tok::l_brace) ? Tok.getLocation() : SourceLocation());
ParsedAttributesWithRange attrs(AttrFactory);
@@ -713,8 +713,8 @@ Decl *Parser::ParseStaticAssertDeclaration(SourceLocation &DeclEnd){
ExpectAndConsumeSemi(diag::err_expected_semi_after_static_assert);
return Actions.ActOnStaticAssertDeclaration(StaticAssertLoc,
- AssertExpr.take(),
- AssertMessage.take(),
+ AssertExpr.get(),
+ AssertMessage.get(),
T.getCloseLocation());
}
@@ -789,7 +789,7 @@ SourceLocation Parser::ParseDecltypeSpecifier(DeclSpec &DS) {
return EndLoc;
}
- Result = Actions.ActOnDecltypeExpression(Result.take());
+ Result = Actions.ActOnDecltypeExpression(Result.get());
}
// Match the ')'
@@ -816,7 +816,7 @@ SourceLocation Parser::ParseDecltypeSpecifier(DeclSpec &DS) {
// Check for duplicate type specifiers (e.g. "int decltype(a)").
if (Result.get()
? DS.SetTypeSpecType(DeclSpec::TST_decltype, StartLoc, PrevSpec,
- DiagID, Result.release(), Policy)
+ DiagID, Result.get(), Policy)
: DS.SetTypeSpecType(DeclSpec::TST_decltype_auto, StartLoc, PrevSpec,
DiagID, Policy)) {
Diag(StartLoc, DiagID) << PrevSpec;
@@ -869,7 +869,7 @@ void Parser::ParseUnderlyingTypeSpecifier(DeclSpec &DS) {
const char *PrevSpec = nullptr;
unsigned DiagID;
if (DS.SetTypeSpecType(DeclSpec::TST_underlyingType, StartLoc, PrevSpec,
- DiagID, Result.release(),
+ DiagID, Result.get(),
Actions.getASTContext().getPrintingPolicy()))
Diag(StartLoc, DiagID) << PrevSpec;
DS.setTypeofParensRange(T.getRange());
@@ -1939,7 +1939,7 @@ void Parser::ParseCXXMemberDeclaratorBeforeInitializer(
if (AsmLabel.isInvalid())
SkipUntil(tok::comma, StopAtSemi | StopBeforeMatch);
- DeclaratorInfo.setAsmLabel(AsmLabel.release());
+ DeclaratorInfo.setAsmLabel(AsmLabel.get());
DeclaratorInfo.SetRangeEnd(Loc);
}
@@ -2305,7 +2305,7 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
ThisDecl = Actions.ActOnCXXMemberDeclarator(getCurScope(), AS,
DeclaratorInfo,
TemplateParams,
- BitfieldSize.release(),
+ BitfieldSize.get(),
VS, HasInClassInit);
if (VarTemplateDecl *VT =
@@ -2893,7 +2893,7 @@ Parser::MemInitResult Parser::ParseMemInitializer(Decl *ConstructorDecl) {
return Actions.ActOnMemInitializer(ConstructorDecl, getCurScope(), SS, II,
TemplateTypeTy, DS, IdLoc,
- InitList.take(), EllipsisLoc);
+ InitList.get(), EllipsisLoc);
} else if(Tok.is(tok::l_paren)) {
BalancedDelimiterTracker T(*this, tok::l_paren);
T.consumeOpen();
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index 209b07138a6..b2381576a2b 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -148,7 +148,7 @@ Parser::ParseExpressionWithLeadingExtension(SourceLocation ExtLoc) {
if (!LHS.isInvalid())
LHS = Actions.ActOnUnaryOp(getCurScope(), ExtLoc, tok::kw___extension__,
- LHS.take());
+ LHS.get());
return ParseRHSOfBinaryExpression(LHS, prec::Comma);
}
@@ -392,11 +392,11 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, prec::Level MinPrec) {
Actions.getExprRange(RHS.get()).getEnd()));
LHS = Actions.ActOnBinOp(getCurScope(), OpToken.getLocation(),
- OpToken.getKind(), LHS.take(), RHS.take());
+ OpToken.getKind(), LHS.get(), RHS.get());
} else
LHS = Actions.ActOnConditionalOp(OpToken.getLocation(), ColonLoc,
- LHS.take(), TernaryMiddle.take(),
- RHS.take());
+ LHS.get(), TernaryMiddle.get(),
+ RHS.get());
}
}
}
@@ -1114,7 +1114,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
if (!Result.isInvalid())
Result = Actions.ActOnNoexceptExpr(KeyLoc, T.getOpenLocation(),
- Result.take(), T.getCloseLocation());
+ Result.get(), T.getCloseLocation());
return Result;
}
@@ -1252,8 +1252,8 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
SourceLocation RLoc = Tok.getLocation();
if (!LHS.isInvalid() && !Idx.isInvalid() && Tok.is(tok::r_square)) {
- LHS = Actions.ActOnArraySubscriptExpr(getCurScope(), LHS.take(), Loc,
- Idx.take(), RLoc);
+ LHS = Actions.ActOnArraySubscriptExpr(getCurScope(), LHS.get(), Loc,
+ Idx.get(), RLoc);
} else
LHS = ExprError();
@@ -1343,7 +1343,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
assert((ArgExprs.size() == 0 ||
ArgExprs.size()-1 == CommaLocs.size())&&
"Unexpected number of commas!");
- LHS = Actions.ActOnCallExpr(getCurScope(), LHS.take(), Loc,
+ LHS = Actions.ActOnCallExpr(getCurScope(), LHS.get(), Loc,
ArgExprs, Tok.getLocation(),
ExecConfig);
PT.consumeClose();
@@ -1362,7 +1362,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
ParsedType ObjectType;
bool MayBePseudoDestructor = false;
if (getLangOpts().CPlusPlus && !LHS.isInvalid()) {
- Expr *Base = LHS.take();
+ Expr *Base = LHS.get();
const Type* BaseType = Base->getType().getTypePtrOrNull();
if (BaseType && Tok.is(tok::l_paren) &&
(BaseType->isFunctionType() ||
@@ -1396,7 +1396,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
}
if (MayBePseudoDestructor && !LHS.isInvalid()) {
- LHS = ParseCXXPseudoDestructor(LHS.take(), OpLoc, OpKind, SS,
+ LHS = ParseCXXPseudoDestructor(LHS.get(), OpLoc, OpKind, SS,
ObjectType);
break;
}
@@ -1430,7 +1430,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
LHS = ExprError();
if (!LHS.isInvalid())
- LHS = Actions.ActOnMemberAccessExpr(getCurScope(), LHS.take(), OpLoc,
+ LHS = Actions.ActOnMemberAccessExpr(getCurScope(), LHS.get(), OpLoc,
OpKind, SS, TemplateKWLoc, Name,
CurParsedObjCImpl ? CurParsedObjCImpl->Dcl
: nullptr,
@@ -1441,7 +1441,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
case tok::minusminus: // postfix-expression: postfix-expression '--'
if (!LHS.isInvalid()) {
LHS = Actions.ActOnPostfixUnaryOp(getCurScope(), Tok.getLocation(),
- Tok.getKind(), LHS.take());
+ Tok.getKind(), LHS.get());
}
ConsumeToken();
break;
@@ -1653,7 +1653,7 @@ ExprResult Parser::ParseUnaryExprOrTypeTraitExpression() {
Operand = Actions.ActOnUnaryExprOrTypeTraitExpr(OpTok.getLocation(),
ExprKind,
/*isType=*/false,
- Operand.release(),
+ Operand.get(),
CastRange);
return Operand;
}
@@ -1711,7 +1711,7 @@ ExprResult Parser::ParseBuiltinPrimaryExpression() {
if (Expr.isInvalid() || Ty.isInvalid())
Res = ExprError();
else
- Res = Actions.ActOnVAArg(StartLoc, Expr.take(), Ty.get(), ConsumeParen());
+ Res = Actions.ActOnVAArg(StartLoc, Expr.get(), Ty.get(), ConsumeParen());
break;
}
case tok::kw___builtin_offsetof: {
@@ -1773,7 +1773,7 @@ ExprResult Parser::ParseBuiltinPrimaryExpression() {
SkipUntil(tok::r_paren, StopAtSemi);
return Res;
}
- Comps.back().U.E = Res.release();
+ Comps.back().U.E = Res.get();
ST.consumeClose();
Comps.back().LocEnd = ST.getCloseLocation();
@@ -1824,8 +1824,8 @@ ExprResult Parser::ParseBuiltinPrimaryExpression() {
Diag(Tok, diag::err_expected) << tok::r_paren;
return ExprError();
}
- Res = Actions.ActOnChooseExpr(StartLoc, Cond.take(), Expr1.take(),
- Expr2.take(), ConsumeParen());
+ Res = Actions.ActOnChooseExpr(StartLoc, Cond.get(), Expr1.get(),
+ Expr2.get(), ConsumeParen());
break;
}
case tok::kw___builtin_astype: {
@@ -1853,7 +1853,7 @@ ExprResult Parser::ParseBuiltinPrimaryExpression() {
return ExprError();
}
- Res = Actions.ActOnAsTypeExpr(Expr.take(), DestTy.get(), StartLoc,
+ Res = Actions.ActOnAsTypeExpr(Expr.get(), DestTy.get(), StartLoc,
ConsumeParen());
break;
}
@@ -1882,7 +1882,7 @@ ExprResult Parser::ParseBuiltinPrimaryExpression() {
return ExprError();
}
- Res = Actions.ActOnConvertVectorExpr(Expr.take(), DestTy.get(), StartLoc,
+ Res = Actions.ActOnConvertVectorExpr(Expr.get(), DestTy.get(), StartLoc,
ConsumeParen());
break;
}
@@ -1893,7 +1893,7 @@ ExprResult Parser::ParseBuiltinPrimaryExpression() {
// These can be followed by postfix-expr pieces because they are
// primary-expressions.
- return ParsePostfixExpressionSuffix(Res.take());
+ return ParsePostfixExpressionSuffix(Res.get());
}
/// ParseParenExpression - This parses the unit that starts with a '(' token,
@@ -1969,7 +1969,7 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr,
// If the substmt parsed correctly, build the AST node.
if (!Stmt.isInvalid()) {
- Result = Actions.ActOnStmtExpr(OpenLoc, Stmt.take(), Tok.getLocation());
+ Result = Actions.ActOnStmtExpr(OpenLoc, Stmt.get(), Tok.getLocation());
} else {
Actions.ActOnStmtExprError();
}
@@ -2096,7 +2096,7 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr,
if (!Result.isInvalid()) {
Result = Actions.ActOnCastExpr(getCurScope(), OpenLoc,
DeclaratorInfo, CastTy,
- RParenLoc, Result.take());
+ RParenLoc, Result.get());
}
return Result;
}
@@ -2125,7 +2125,7 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr,
// Don't build a paren expression unless we actually match a ')'.
if (!Result.isInvalid() && Tok.is(tok::r_paren))
Result =
- Actions.ActOnParenExpr(OpenLoc, Tok.getLocation(), Result.take());
+ Actions.ActOnParenExpr(OpenLoc, Tok.getLocation(), Result.get());
}
// Match the ')'.
@@ -2156,7 +2156,7 @@ Parser::ParseCompoundLiteralExpression(ParsedType Ty,
Diag(LParenLoc, diag::ext_c99_compound_literal);
ExprResult Result = ParseInitializer();
if (!Result.isInvalid() && Ty)
- return Actions.ActOnCompoundLiteral(LParenLoc, Ty, RParenLoc, Result.take());
+ return Actions.ActOnCompoundLiteral(LParenLoc, Ty, RParenLoc, Result.get());
return Result;
}
@@ -2250,7 +2250,7 @@ ExprResult Parser::ParseGenericSelectionExpression() {
SkipUntil(tok::r_paren, StopAtSemi);
return ExprError();
}
- Ty = TR.release();
+ Ty = TR.get();
}
Types.push_back(Ty);
@@ -2266,7 +2266,7 @@ ExprResult Parser::ParseGenericSelectionExpression() {
SkipUntil(tok::r_paren, StopAtSemi);
return ExprError();
}
- Exprs.push_back(ER.release());
+ Exprs.push_back(ER.get());
} while (TryConsumeToken(tok::comma));
T.consumeClose();
@@ -2275,7 +2275,7 @@ ExprResult Parser::ParseGenericSelectionExpression() {
return Actions.ActOnGenericSelectionExpr(KeyLoc, DefaultLoc,
T.getCloseLocation(),
- ControllingExpr.release(),
+ ControllingExpr.get(),
Types, Exprs);
}
@@ -2329,7 +2329,7 @@ bool Parser::ParseExpressionList(SmallVectorImpl<Expr*> &Exprs,
if (Expr.isInvalid())
return true;
- Exprs.push_back(Expr.release());
+ Exprs.push_back(Expr.get());
if (Tok.isNot(tok::comma))
return false;
@@ -2354,7 +2354,7 @@ Parser::ParseSimpleExpressionList(SmallVectorImpl<Expr*> &Exprs,
if (Expr.isInvalid())
return true;
- Exprs.push_back(Expr.release());
+ Exprs.push_back(Expr.get());
if (Tok.isNot(tok::comma))
return false;
@@ -2496,7 +2496,7 @@ ExprResult Parser::ParseBlockLiteralExpression() {
StmtResult Stmt(ParseCompoundStatementBody());
BlockScope.Exit();
if (!Stmt.isInvalid())
- Result = Actions.ActOnBlockStmtExpr(CaretLoc, Stmt.take(), getCurScope());
+ Result = Actions.ActOnBlockStmtExpr(CaretLoc, Stmt.get(), getCurScope());
else
Actions.ActOnBlockError(CaretLoc, getCurScope());
return Result;
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp
index ff19826678b..d4f686b5e1f 100644
--- a/clang/lib/Parse/ParseExprCXX.cpp
+++ b/clang/lib/Parse/ParseExprCXX.cpp
@@ -1184,7 +1184,7 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer(
BodyScope.Exit();
if (!Stmt.isInvalid())
- return Actions.ActOnLambdaExpr(LambdaBeginLoc, Stmt.take(), getCurScope());
+ return Actions.ActOnLambdaExpr(LambdaBeginLoc, Stmt.get(), getCurScope());
Actions.ActOnLambdaError(LambdaBeginLoc, getCurScope());
return ExprError();
@@ -1253,7 +1253,7 @@ ExprResult Parser::ParseCXXCasts() {
Result = Actions.ActOnCXXNamedCast(OpLoc, Kind,
LAngleBracketLoc, DeclaratorInfo,
RAngleBracketLoc,
- T.getOpenLocation(), Result.take(),
+ T.getOpenLocation(), Result.get(),
T.getCloseLocation());
return Result;
@@ -1319,7 +1319,7 @@ ExprResult Parser::ParseCXXTypeid() {
return ExprError();
Result = Actions.ActOnCXXTypeid(OpLoc, LParenLoc, /*isType=*/false,
- Result.release(), RParenLoc);
+ Result.get(), RParenLoc);
}
}
@@ -1367,7 +1367,7 @@ ExprResult Parser::ParseCXXUuidof() {
Result = Actions.ActOnCXXUuidof(OpLoc, T.getOpenLocation(),
/*isType=*/false,
- Result.release(), T.getCloseLocation());
+ Result.get(), T.getCloseLocation());
}
}
@@ -1494,7 +1494,7 @@ ExprResult Parser::ParseThrowExpression() {
default:
ExprResult Expr(ParseAssignmentExpression());
if (Expr.isInvalid()) return Expr;
- return Actions.ActOnCXXThrow(getCurScope(), ThrowLoc, Expr.take());
+ return Actions.ActOnCXXThrow(getCurScope(), ThrowLoc, Expr.get());
}
}
@@ -1534,7 +1534,7 @@ Parser::ParseCXXTypeConstructExpression(const DeclSpec &DS) {
ExprResult Init = ParseBraceInitializer();
if (Init.isInvalid())
return Init;
- Expr *InitList = Init.take();
+ Expr *InitList = Init.get();
return Actions.ActOnCXXTypeConstructExpr(TypeRep, SourceLocation(),
MultiExprArg(&InitList, 1),
SourceLocation());
@@ -1636,7 +1636,7 @@ bool Parser::ParseCXXCondition(ExprResult &ExprOut,
SkipUntil(tok::semi, StopAtSemi);
return true;
}
- DeclaratorInfo.setAsmLabel(AsmLabel.release());
+ DeclaratorInfo.setAsmLabel(AsmLabel.get());
DeclaratorInfo.SetRangeEnd(Loc);
}
@@ -1676,7 +1676,7 @@ bool Parser::ParseCXXCondition(ExprResult &ExprOut,
}
if (!InitExpr.isInvalid())
- Actions.AddInitializerToDecl(DeclOut, InitExpr.take(), !CopyInitialization,
+ Actions.AddInitializerToDecl(DeclOut, InitExpr.get(), !CopyInitialization,
DS.containsPlaceholderType());
else
Actions.ActOnInitializerError(DeclOut);
@@ -2617,7 +2617,7 @@ Parser::ParseCXXNewExpression(bool UseGlobal, SourceLocation Start) {
return Actions.ActOnCXXNew(Start, UseGlobal, PlacementLParen,
PlacementArgs, PlacementRParen,
- TypeIdParens, DeclaratorInfo, Initializer.take());
+ TypeIdParens, DeclaratorInfo, Initializer.get());
}
/// ParseDirectNewDeclarator - Parses a direct-new-declarator. Intended to be
@@ -2655,7 +2655,7 @@ void Parser::ParseDirectNewDeclarator(Declarator &D) {
D.AddTypeInfo(DeclaratorChunk::getArray(0,
/*static=*/false, /*star=*/false,
- Size.release(),
+ Size.get(),
T.getOpenLocation(),
T.getCloseLocation()),
Attrs, T.getCloseLocation());
@@ -2732,7 +2732,7 @@ Parser::ParseCXXDeleteExpression(bool UseGlobal, SourceLocation Start) {
if (Operand.isInvalid())
return Operand;
- return Actions.ActOnCXXDelete(Start, UseGlobal, ArrayDelete, Operand.take());
+ return Actions.ActOnCXXDelete(Start, UseGlobal, ArrayDelete, Operand.get());
}
static TypeTrait TypeTraitFromTokKind(tok::TokenKind kind) {
@@ -3017,7 +3017,7 @@ Parser::ParseCXXAmbiguousParenExpression(ParenParseOption &ExprType,
if (!Result.isInvalid())
Result = Actions.ActOnCastExpr(getCurScope(), Tracker.getOpenLocation(),
DeclaratorInfo, CastTy,
- Tracker.getCloseLocation(), Result.take());
+ Tracker.getCloseLocation(), Result.get());
return Result;
}
@@ -3028,7 +3028,7 @@ Parser::ParseCXXAmbiguousParenExpression(ParenParseOption &ExprType,
Result = ParseExpression();
if (!Result.isInvalid() && Tok.is(tok::r_paren))
Result = Actions.ActOnParenExpr(Tracker.getOpenLocation(),
- Tok.getLocation(), Result.take());
+ Tok.getLocation(), Result.get());
// Match the ')'.
if (Result.isInvalid()) {
diff --git a/clang/lib/Parse/ParseInit.cpp b/clang/lib/Parse/ParseInit.cpp
index 163b35a24df..8536420088f 100644
--- a/clang/lib/Parse/ParseInit.cpp
+++ b/clang/lib/Parse/ParseInit.cpp
@@ -309,12 +309,12 @@ ExprResult Parser::ParseInitializerWithPotentialDesignator() {
return ParseAssignmentExprWithObjCMessageExprStart(StartLoc,
SourceLocation(),
ParsedType(),
- Idx.take());
+ Idx.get());
}
// If this is a normal array designator, remember it.
if (Tok.isNot(tok::ellipsis)) {
- Desig.AddDesignator(Designator::getArray(Idx.release(), StartLoc));
+ Desig.AddDesignator(Designator::getArray(Idx.get(), StartLoc));
} else {
// Handle the gnu array range extension.
Diag(Tok, diag::ext_gnu_array_range);
@@ -325,8 +325,8 @@ ExprResult Parser::ParseInitializerWithPotentialDesignator() {
SkipUntil(tok::r_square, StopAtSemi);
return RHS;
}
- Desig.AddDesignator(Designator::getArrayRange(Idx.release(),
- RHS.release(),
+ Desig.AddDesignator(Designator::getArrayRange(Idx.get(),
+ RHS.get(),
StartLoc, EllipsisLoc));
}
@@ -426,7 +426,7 @@ ExprResult Parser::ParseBraceInitializer() {
// If we couldn't parse the subelement, bail out.
if (!SubElt.isInvalid()) {
- InitExprs.push_back(SubElt.release());
+ InitExprs.push_back(SubElt.get());
} else {
InitExprsOk = false;
@@ -509,7 +509,7 @@ bool Parser::ParseMicrosoftIfExistsBraceInitializer(ExprVector &InitExprs,
// If we couldn't parse the subelement, bail out.
if (!SubElt.isInvalid())
- InitExprs.push_back(SubElt.release());
+ InitExprs.push_back(SubElt.get());
else
InitExprsOk = false;
diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp
index 2878aa094d2..e3fd7adfdf2 100644
--- a/clang/lib/Parse/ParseObjc.cpp
+++ b/clang/lib/Parse/ParseObjc.cpp
@@ -1783,7 +1783,7 @@ StmtResult Parser::ParseObjCThrowStmt(SourceLocation atLoc) {
}
// consume ';'
ExpectAndConsume(tok::semi, diag::err_expected_after, "@throw");
- return Actions.ActOnObjCAtThrowStmt(atLoc, Res.take(), getCurScope());
+ return Actions.ActOnObjCAtThrowStmt(atLoc, Res.get(), getCurScope());
}
/// objc-synchronized-statement:
@@ -1820,7 +1820,7 @@ Parser::ParseObjCSynchronizedStmt(SourceLocation atLoc) {
// Check the @synchronized operand now.
if (!operand.isInvalid())
- operand = Actions.ActOnObjCAtSynchronizedOperand(atLoc, operand.take());
+ operand = Actions.ActOnObjCAtSynchronizedOperand(atLoc, operand.get());
// Parse the compound statement within a new scope.
ParseScope bodyScope(this, Scope::DeclScope);
@@ -1911,9 +1911,9 @@ StmtResult Parser::ParseObjCTryStmt(SourceLocation atLoc) {
StmtResult Catch = Actions.ActOnObjCAtCatchStmt(AtCatchFinallyLoc,
RParenLoc,
FirstPart,
- CatchBody.take());
+ CatchBody.get());
if (!Catch.isInvalid())
- CatchStmts.push_back(Catch.release());
+ CatchStmts.push_back(Catch.get());
} else {
Diag(AtCatchFinallyLoc, diag::err_expected_lparen_after)
@@ -1934,7 +1934,7 @@ StmtResult Parser::ParseObjCTryStmt(SourceLocation atLoc) {
if (FinallyBody.isInvalid())
FinallyBody = Actions.ActOnNullStmt(Tok.getLocation());
FinallyStmt = Actions.ActOnObjCAtFinallyStmt(AtCatchFinallyLoc,
- FinallyBody.take());
+ FinallyBody.get());
catch_or_finally_seen = true;
break;
}
@@ -1944,9 +1944,9 @@ StmtResult Parser::ParseObjCTryStmt(SourceLocation atLoc) {
return StmtError();
}
- return Actions.ActOnObjCAtTryStmt(atLoc, TryBody.take(),
+ return Actions.ActOnObjCAtTryStmt(atLoc, TryBody.get(),
CatchStmts,
- FinallyStmt.take());
+ FinallyStmt.get());
}
/// objc-autoreleasepool-statement:
@@ -1969,7 +1969,7 @@ Parser::ParseObjCAutoreleasePoolStmt(SourceLocation atLoc) {
if (AutoreleasePoolBody.isInvalid())
AutoreleasePoolBody = Actions.ActOnNullStmt(Tok.getLocation());
return Actions.ActOnObjCAutoreleasePoolStmt(atLoc,
- AutoreleasePoolBody.take());
+ AutoreleasePoolBody.get());
}
/// StashAwayMethodOrFunctionBodyTokens - Consume the tokens and store them
@@ -2116,12 +2116,12 @@ ExprResult Parser::ParseObjCAtExpression(SourceLocation AtLoc) {
}
ConsumeToken(); // Consume the literal token.
- Lit = Actions.ActOnUnaryOp(getCurScope(), OpLoc, Kind, Lit.take());
+ Lit = Actions.ActOnUnaryOp(getCurScope(), OpLoc, Kind, Lit.get());
if (Lit.isInvalid())
return Lit;
return ParsePostfixExpressionSuffix(
- Actions.BuildObjCNumericLiteral(AtLoc, Lit.take()));
+ Actions.BuildObjCNumericLiteral(AtLoc, Lit.get()));
}
case tok::string_literal: // primary-expression: string-literal
@@ -2222,7 +2222,7 @@ bool Parser::ParseObjCXXMessageReceiver(bool &IsExpr, void *&TypeOrExpr) {
return true;
IsExpr = true;
- TypeOrExpr = Receiver.take();
+ TypeOrExpr = Receiver.get();
return false;
}
@@ -2248,14 +2248,14 @@ bool Parser::ParseObjCXXMessageReceiver(bool &IsExpr, void *&TypeOrExpr) {
// instance method.
ExprResult Receiver = ParseCXXTypeConstructExpression(DS);
if (!Receiver.isInvalid())
- Receiver = ParsePostfixExpressionSuffix(Receiver.take());
+ Receiver = ParsePostfixExpressionSuffix(Receiver.get());
if (!Receiver.isInvalid())
- Receiver = ParseRHSOfBinaryExpression(Receiver.take(), prec::Comma);
+ Receiver = ParseRHSOfBinaryExpression(Receiver.get(), prec::Comma);
if (Receiver.isInvalid())
return true;
IsExpr = true;
- TypeOrExpr = Receiver.take();
+ TypeOrExpr = Receiver.get();
return false;
}
@@ -2401,7 +2401,7 @@ ExprResult Parser::ParseObjCMessageExpression() {
}
return ParseObjCMessageExpressionBody(LBracLoc, SourceLocation(),
- ParsedType(), Res.take());
+ ParsedType(), Res.get());
}
/// \brief Parse the remainder of an Objective-C message following the
@@ -2522,7 +2522,7 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc,
}
// We have a valid expression.
- KeyExprs.push_back(Res.release());
+ KeyExprs.push_back(Res.get());
// Code completion after each argument.
if (Tok.is(tok::code_completion)) {
@@ -2566,7 +2566,7 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc,
}
// We have a valid expression.
- KeyExprs.push_back(Res.release());
+ KeyExprs.push_back(Res.get());
}
} else if (!selIdent) {
Diag(Tok, diag::err_expected) << tok::identifier; // missing selector name.
@@ -2617,7 +2617,7 @@ ExprResult Parser::ParseObjCStringLiteral(SourceLocation AtLoc) {
SmallVector<SourceLocation, 4> AtLocs;
ExprVector AtStrings;
AtLocs.push_back(AtLoc);
- AtStrings.push_back(Res.release());
+ AtStrings.push_back(Res.get());
while (Tok.is(tok::at)) {
AtLocs.push_back(ConsumeToken()); // eat the @.
@@ -2630,7 +2630,7 @@ ExprResult Parser::ParseObjCStringLiteral(SourceLocation AtLoc) {
if (Lit.isInvalid())
return Lit;
- AtStrings.push_back(Lit.release());
+ AtStrings.push_back(Lit.get());
}
return Actions.ParseObjCStringLiteral(&AtLocs[0], AtStrings.data(),
@@ -2657,7 +2657,7 @@ ExprResult Parser::ParseObjCCharacterLiteral(SourceLocation AtLoc) {
return Lit;
}
ConsumeToken(); // Consume the literal token.
- return Actions.BuildObjCNumericLiteral(AtLoc, Lit.take());
+ return Actions.BuildObjCNumericLiteral(AtLoc, Lit.get());
}
/// ParseObjCNumericLiteral -
@@ -2671,7 +2671,7 @@ ExprResult Parser::ParseObjCNumericLiteral(SourceLocation AtLoc) {
return Lit;
}
ConsumeToken(); // Consume the literal token.
- return Actions.BuildObjCNumericLiteral(AtLoc, Lit.take());
+ return Actions.BuildObjCNumericLiteral(AtLoc, Lit.get());
}
/// ParseObjCBoxedExpr -
@@ -2694,9 +2694,9 @@ Parser::ParseObjCBoxedExpr(SourceLocation AtLoc) {
// Wrap the sub-expression in a parenthesized expression, to distinguish
// a boxed expression from a literal.
SourceLocation LPLoc = T.getOpenLocation(), RPLoc = T.getCloseLocation();
- ValueExpr = Actions.ActOnParenExpr(LPLoc, RPLoc, ValueExpr.take());
+ ValueExpr = Actions.ActOnParenExpr(LPLoc, RPLoc, ValueExpr.get());
return Actions.BuildObjCBoxedExpr(SourceRange(AtLoc, RPLoc),
- ValueExpr.take());
+ ValueExpr.get());
}
ExprResult Parser::ParseObjCArrayLiteral(SourceLocation AtLoc) {
@@ -2720,7 +2720,7 @@ ExprResult Parser::ParseObjCArrayLiteral(SourceLocation AtLoc) {
if (Res.isInvalid())
return true;
- ElementExprs.push_back(Res.release());
+ ElementExprs.push_back(Res.get());
if (Tok.is(tok::comma))
ConsumeToken(); // Eat the ','.
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 3a2a51e90db..c053aac3400 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -155,13 +155,13 @@ StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective() {
Actions.ActOnCapturedRegionError();
CreateDirective = false;
} else {
- AssociatedStmt = Actions.ActOnCapturedRegionEnd(AssociatedStmt.take());
+ AssociatedStmt = Actions.ActOnCapturedRegionEnd(AssociatedStmt.get());
CreateDirective = AssociatedStmt.isUsable();
}
}
if (CreateDirective)
Directive = Actions.ActOnOpenMPExecutableDirective(
- DKind, Clauses, AssociatedStmt.take(), Loc, EndLoc);
+ DKind, Clauses, AssociatedStmt.get(), Loc, EndLoc);
// Exit scope.
Actions.EndOpenMPDSABlock(Directive.get());
@@ -231,7 +231,7 @@ bool Parser::ParseOpenMPSimpleVarList(OpenMPDirectiveKind Kind,
ExprResult Res =
Actions.ActOnOpenMPIdExpression(getCurScope(), SS, NameInfo);
if (Res.isUsable())
- VarList.push_back(Res.take());
+ VarList.push_back(Res.get());
}
// Consume ','.
if (Tok.is(tok::comma)) {
@@ -355,7 +355,7 @@ OMPClause *Parser::ParseOpenMPSingleExprClause(OpenMPClauseKind Kind) {
return nullptr;
return Actions.ActOnOpenMPSingleExprClause(
- Kind, Val.take(), Loc, T.getOpenLocation(), T.getCloseLocation());
+ Kind, Val.get(), Loc, T.getOpenLocation(), T.getCloseLocation());
}
/// \brief Parsing of simple OpenMP clauses like 'default' or 'proc_bind'.
@@ -420,7 +420,7 @@ OMPClause *Parser::ParseOpenMPVarListClause(OpenMPClauseKind Kind) {
// Parse variable
ExprResult VarExpr = ParseAssignmentExpression();
if (VarExpr.isUsable()) {
- Vars.push_back(VarExpr.take());
+ Vars.push_back(VarExpr.get());
} else {
SkipUntil(tok::comma, tok::r_paren, tok::annot_pragma_openmp_end,
StopBeforeMatch);
@@ -443,7 +443,7 @@ OMPClause *Parser::ParseOpenMPVarListClause(OpenMPClauseKind Kind) {
ConsumeToken();
ExprResult Tail = ParseAssignmentExpression();
if (Tail.isUsable())
- TailExpr = Tail.take();
+ TailExpr = Tail.get();
else
SkipUntil(tok::comma, tok::r_paren, tok::annot_pragma_openmp_end,
StopBeforeMatch);
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index 9d44f51bc97..1ee7c965c6f 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -445,8 +445,8 @@ StmtResult Parser::ParseSEHTryBlockCommon(SourceLocation TryLoc) {
return Actions.ActOnSEHTryBlock(false /* IsCXXTry */,
TryLoc,
- TryBlock.take(),
- Handler.take());
+ TryBlock.get(),
+ Handler.get());
}
/// ParseSEHExceptBlock - Handle __except
@@ -488,7 +488,7 @@ StmtResult Parser::ParseSEHExceptBlock(SourceLocation ExceptLoc) {
if(Block.isInvalid())
return Block;
- return Actions.ActOnSEHExceptBlock(ExceptLoc, FilterExpr.take(), Block.take());
+ return Actions.ActOnSEHExceptBlock(ExceptLoc, FilterExpr.get(), Block.get());
}
/// ParseSEHFinallyBlock - Handle __finally
@@ -505,7 +505,7 @@ StmtResult Parser::ParseSEHFinallyBlock(SourceLocation FinallyBlock) {
if(Block.isInvalid())
return Block;
- return Actions.ActOnSEHFinallyBlock(FinallyBlock,Block.take());
+ return Actions.ActOnSEHFinallyBlock(FinallyBlock,Block.get());
}
/// ParseLabeledStatement - We have an identifier and a ':' after it.
@@ -915,7 +915,7 @@ StmtResult Parser::ParseCompoundStatementBody(bool isStmtExpr) {
ExpectAndConsumeSemi(diag::err_expected_semi_declaration);
if (R.isUsable())
- Stmts.push_back(R.release());
+ Stmts.push_back(R.get());
}
while (Tok.isNot(tok::r_brace) && !isEofOrEom()) {
@@ -975,7 +975,7 @@ StmtResult Parser::ParseCompoundStatementBody(bool isStmtExpr) {
}
if (R.isUsable())
- Stmts.push_back(R.release());
+ Stmts.push_back(R.get());
}
SourceLocation CloseLoc = Tok.getLocation();
@@ -1596,7 +1596,7 @@ StmtResult Parser::ParseForStatement(SourceLocation *TrailingElseLoc) {
ExprResult Third = ParseExpression();
// FIXME: The C++11 standard doesn't actually say that this is a
// discarded-value expression, but it clearly should be.
- ThirdPart = Actions.MakeFullDiscardedValueExpr(Third.take());
+ ThirdPart = Actions.MakeFullDiscardedValueExpr(Third.get());
}
}
// Match the ')'.
@@ -1609,7 +1609,7 @@ StmtResult Parser::ParseForStatement(SourceLocation *TrailingElseLoc) {
StmtResult ForEachStmt;
if (ForRange) {
- ForRangeStmt = Actions.ActOnCXXForRangeStmt(ForLoc, FirstPart.take(),
+ ForRangeStmt = Actions.ActOnCXXForRangeStmt(ForLoc, FirstPart.get(),
ForRangeInit.ColonLoc,
ForRangeInit.RangeExpr.get(),
T.getCloseLocation(),
@@ -1620,8 +1620,8 @@ StmtResult Parser::ParseForStatement(SourceLocation *TrailingElseLoc) {
// statement immediately in order to close over temporaries correctly.
} else if (ForEach) {
ForEachStmt = Actions.ActOnObjCForCollectionStmt(ForLoc,
- FirstPart.take(),
- Collection.take(),
+ FirstPart.get(),
+ Collection.get(),
T.getCloseLocation());
}
@@ -1659,15 +1659,15 @@ StmtResult Parser::ParseForStatement(SourceLocation *TrailingElseLoc) {
return StmtError();
if (ForEach)
- return Actions.FinishObjCForCollectionStmt(ForEachStmt.take(),
- Body.take());
+ return Actions.FinishObjCForCollectionStmt(ForEachStmt.get(),
+ Body.get());
if (ForRange)
- return Actions.FinishCXXForRangeStmt(ForRangeStmt.take(), Body.take());
+ return Actions.FinishCXXForRangeStmt(ForRangeStmt.get(), Body.get());
- return Actions.ActOnForStmt(ForLoc, T.getOpenLocation(), FirstPart.take(),
+ return Actions.ActOnForStmt(ForLoc, T.getOpenLocation(), FirstPart.get(),
SecondPart, SecondVar, ThirdPart,
- T.getCloseLocation(), Body.take());
+ T.getCloseLocation(), Body.get());
}
/// ParseGotoStatement
@@ -1696,7 +1696,7 @@ StmtResult Parser::ParseGotoStatement() {
SkipUntil(tok::semi, StopBeforeMatch);
return StmtError();
}
- Res = Actions.ActOnIndirectGotoStmt(GotoLoc, StarLoc, R.take());
+ Res = Actions.ActOnIndirectGotoStmt(GotoLoc, StarLoc, R.get());
} else {
Diag(Tok, diag::err_expected) << tok::identifier;
return StmtError();
@@ -1756,7 +1756,7 @@ StmtResult Parser::ParseReturnStatement() {
return StmtError();
}
}
- return Actions.ActOnReturnStmt(ReturnLoc, R.take(), getCurScope());
+ return Actions.ActOnReturnStmt(ReturnLoc, R.get(), getCurScope());
}
namespace {
@@ -1818,7 +1818,7 @@ namespace {
}
// Initialize the "decl" with the lookup result.
- Info.OpDecl = static_cast<void*>(Result.take());
+ Info.OpDecl = static_cast<void*>(Result.get());
return Info.OpDecl;
}
@@ -2254,7 +2254,7 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) {
// Need address of variable.
if (OpExprs[i].second)
OpExpr = Actions.BuildUnaryOp(getCurScope(), AsmLoc, UO_AddrOf, OpExpr)
- .take();
+ .get();
ConstraintRefs[i] = StringRef(Constraints[i]);
Exprs[i] = OpExpr;
@@ -2334,7 +2334,7 @@ StmtResult Parser::ParseAsmStatement(bool &msAsm) {
T.consumeClose();
return Actions.ActOnGCCAsmStmt(AsmLoc, /*isSimple*/ true, isVolatile,
/*NumOutputs*/ 0, /*NumInputs*/ 0, nullptr,
- Constraints, Exprs, AsmString.take(),
+ Constraints, Exprs, AsmString.get(),
Clobbers, T.getCloseLocation());
}
@@ -2387,7 +2387,7 @@ StmtResult Parser::ParseAsmStatement(bool &msAsm) {
if (Clobber.isInvalid())
break;
- Clobbers.push_back(Clobber.release());
+ Clobbers.push_back(Clobber.get());
if (!TryConsumeToken(tok::comma))
break;
@@ -2398,7 +2398,7 @@ StmtResult Parser::ParseAsmStatement(bool &msAsm) {
T.consumeClose();
return Actions.ActOnGCCAsmStmt(AsmLoc, false, isVolatile, NumOutputs,
NumInputs, Names.data(), Constraints, Exprs,
- AsmString.take(), Clobbers,
+ AsmString.get(), Clobbers,
T.getCloseLocation());
}
@@ -2447,7 +2447,7 @@ bool Parser::ParseAsmOperandsOpt(SmallVectorImpl<IdentifierInfo *> &Names,
SkipUntil(tok::r_paren, StopAtSemi);
return true;
}
- Constraints.push_back(Constraint.release());
+ Constraints.push_back(Constraint.get());
if (Tok.isNot(tok::l_paren)) {
Diag(Tok, diag::err_expected_lparen_after) << "asm operand";
@@ -2464,7 +2464,7 @@ bool Parser::ParseAsmOperandsOpt(SmallVectorImpl<IdentifierInfo *> &Names,
SkipUntil(tok::r_paren, StopAtSemi);
return true;
}
- Exprs.push_back(Res.release());
+ Exprs.push_back(Res.get());
// Eat the comma and continue parsing if it exists.
if (!TryConsumeToken(tok::comma))
return false;
@@ -2496,7 +2496,7 @@ Decl *Parser::ParseFunctionStatementBody(Decl *Decl, ParseScope &BodyScope) {
}
BodyScope.Exit();
- return Actions.ActOnFinishFunctionBody(Decl, FnBody.take());
+ return Actions.ActOnFinishFunctionBody(Decl, FnBody.get());
}
/// ParseFunctionTryBlock - Parse a C++ function-try-block.
@@ -2533,7 +2533,7 @@ Decl *Parser::ParseFunctionTryBlock(Decl *Decl, ParseScope &BodyScope) {
}
BodyScope.Exit();
- return Actions.ActOnFinishFunctionBody(Decl, FnBody.take());
+ return Actions.ActOnFinishFunctionBody(Decl, FnBody.get());
}
bool Parser::trySkippingFunctionBody() {
@@ -2619,8 +2619,8 @@ StmtResult Parser::ParseCXXTryBlockCommon(SourceLocation TryLoc, bool FnTry) {
return Actions.ActOnSEHTryBlock(true /* IsCXXTry */,
TryLoc,
- TryBlock.take(),
- Handler.take());
+ TryBlock.get(),
+ Handler.get());
}
else {
StmtVector Handlers;
@@ -2634,14 +2634,14 @@ StmtResult Parser::ParseCXXTryBlockCommon(SourceLocation TryLoc, bool FnTry) {
while (Tok.is(tok::kw_catch)) {
StmtResult Handler(ParseCXXCatchBlock(FnTry));
if (!Handler.isInvalid())
- Handlers.push_back(Handler.release());
+ Handlers.push_back(Handler.get());
}
// Don't bother creating the full statement if we don't have any usable
// handlers.
if (Handlers.empty())
return StmtError();
- return Actions.ActOnCXXTryBlock(TryLoc, TryBlock.take(), Handlers);
+ return Actions.ActOnCXXTryBlock(TryLoc, TryBlock.get(), Handlers);
}
}
@@ -2701,7 +2701,7 @@ StmtResult Parser::ParseCXXCatchBlock(bool FnCatch) {
if (Block.isInvalid())
return Block;
- return Actions.ActOnCXXCatchBlock(CatchLoc, ExceptionDecl, Block.take());
+ return Actions.ActOnCXXCatchBlock(CatchLoc, ExceptionDecl, Block.get());
}
void Parser::ParseMicrosoftIfExistsStatement(StmtVector &Stmts) {
@@ -2756,7 +2756,7 @@ void Parser::ParseMicrosoftIfExistsStatement(StmtVector &Stmts) {
while (Tok.isNot(tok::r_brace)) {
StmtResult R = ParseStatementOrDeclaration(Stmts, false);
if (R.isUsable())
- Stmts.push_back(R.release());
+ Stmts.push_back(R.get());
}
Braces.consumeClose();
}
diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp
index d8fbe0c2643..a4a7abc1f6c 100644
--- a/clang/lib/Parse/ParseTemplate.cpp
+++ b/clang/lib/Parse/ParseTemplate.cpp
@@ -651,7 +651,7 @@ Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsigned Position) {
// Create the parameter.
return Actions.ActOnNonTypeTemplateParameter(getCurScope(), ParamDecl,
Depth, Position, EqualLoc,
- DefaultArg.take());
+ DefaultArg.get());
}
/// \brief Parses a '>' at the end of a template list.
@@ -1118,7 +1118,7 @@ ParsedTemplateArgument Parser::ParseTemplateArgument() {
return ParsedTemplateArgument();
return ParsedTemplateArgument(ParsedTemplateArgument::NonType,
- ExprArg.release(), Loc);
+ ExprArg.get(), Loc);
}
/// \brief Determine whether the current tokens can only be parsed as a
OpenPOWER on IntegriCloud