mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Address llvm::PointerUnion::{is,get} deprecations
These were deprecated in https://github.com/llvm/llvm-project/pull/122623.
This commit is contained in:
@@ -158,7 +158,7 @@ swift::refactoring::checkExtractConditions(const ResolvedRangeInfo &RangeInfo,
|
||||
|
||||
// Disallow extracting certain kinds of statements.
|
||||
if (RangeInfo.Kind == RangeKind::SingleStatement) {
|
||||
Stmt *S = RangeInfo.ContainedNodes[0].get<Stmt *>();
|
||||
Stmt *S = cast<Stmt *>(RangeInfo.ContainedNodes[0]);
|
||||
|
||||
// These aren't independent statement.
|
||||
if (isa<BraceStmt>(S) || isa<CaseStmt>(S))
|
||||
@@ -167,7 +167,7 @@ swift::refactoring::checkExtractConditions(const ResolvedRangeInfo &RangeInfo,
|
||||
|
||||
// Disallow extracting literals.
|
||||
if (RangeInfo.Kind == RangeKind::SingleExpression) {
|
||||
Expr *E = RangeInfo.ContainedNodes[0].get<Expr *>();
|
||||
Expr *E = cast<Expr *>(RangeInfo.ContainedNodes[0]);
|
||||
|
||||
// Until implementing the performChange() part of extracting trailing
|
||||
// closures, we disable them for now.
|
||||
@@ -211,7 +211,7 @@ bool RefactoringActionExtractExprBase::performChange() {
|
||||
ContextFinder Finder(*TheFile, RangeInfo.ContainedNodes.front(),
|
||||
[](ASTNode N) { return N.isStmt(StmtKind::Brace); });
|
||||
|
||||
auto *SelectedExpr = RangeInfo.ContainedNodes[0].get<Expr *>();
|
||||
auto *SelectedExpr = cast<Expr *>(RangeInfo.ContainedNodes[0]);
|
||||
Finder.resolve();
|
||||
SourceLoc InsertLoc;
|
||||
llvm::SetVector<ValueDecl *> AllVisibleDecls;
|
||||
@@ -231,7 +231,7 @@ bool RefactoringActionExtractExprBase::performChange() {
|
||||
|
||||
// Get the innermost brace statement.
|
||||
auto BS =
|
||||
static_cast<BraceStmt *>(Finder.getContexts().back().get<Stmt *>());
|
||||
static_cast<BraceStmt *>(cast<Stmt *>(Finder.getContexts().back()));
|
||||
|
||||
// Collect all value decls inside the brace statement.
|
||||
Collector.walk(BS);
|
||||
|
||||
Reference in New Issue
Block a user