Some utilities for using the smart pointers in Actions, especially Sema. Convert a few functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60983 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 201e9d3..ed15140 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -294,7 +294,7 @@
SkipUntil(tok::semi);
return 0;
}
- Actions.AddInitializerToDecl(LastDeclInGroup, Init.release());
+ Actions.AddInitializerToDecl(LastDeclInGroup, move_convert(Init));
} else if (Tok.is(tok::l_paren)) {
// Parse C++ direct initializer: '(' expression-list ')'
SourceLocation LParenLoc = ConsumeParen();
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index 994e783..5f2ebad 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -1364,12 +1364,12 @@
// If the function body could not be parsed, make a bogus compoundstmt.
if (FnBody.isInvalid())
FnBody = Actions.ActOnCompoundStmt(BraceLoc, BraceLoc, 0, 0, false);
-
+
// Leave the function body scope.
BodyScope.Exit();
-
+
// TODO: Pass argument information.
- Actions.ActOnFinishFunctionBody(MDecl, FnBody.release());
+ Actions.ActOnFinishFunctionBody(MDecl, move_convert(FnBody));
return MDecl;
}
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp
index ed4563b..9f8771c 100644
--- a/lib/Parse/ParseStmt.cpp
+++ b/lib/Parse/ParseStmt.cpp
@@ -1240,5 +1240,5 @@
if (FnBody.isInvalid())
FnBody = Owned(Actions.ActOnCompoundStmt(L, R, 0, 0, false));
- return Actions.ActOnFinishFunctionBody(Decl, FnBody.release());
+ return Actions.ActOnFinishFunctionBody(Decl, move_convert(FnBody));
}
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index 1cd7c0e..058182e 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -342,7 +342,8 @@
"top-level asm block");
if (!Result.isInvalid())
- return Actions.ActOnFileScopeAsmDecl(Tok.getLocation(), Result.release());
+ return Actions.ActOnFileScopeAsmDecl(Tok.getLocation(),
+ move_convert(Result));
return 0;
}
case tok::at: