Skip to content

Commit 0b1f0e4

Browse files
authored
Merge pull request #26112 from slavapestov/object-literal-semantic-expr
AST: Remove ObjectLiteralExpr::{get,set}SemanticExpr()
2 parents 7c78a7a + 366f758 commit 0b1f0e4

File tree

5 files changed

+1
-11
lines changed

5 files changed

+1
-11
lines changed

include/swift/AST/Expr.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,6 @@ class ObjectLiteralExpr final
11311131

11321132
private:
11331133
Expr *Arg;
1134-
Expr *SemanticExpr;
11351134
SourceLoc PoundLoc;
11361135
ConcreteDeclRef Initializer;
11371136

@@ -1181,9 +1180,6 @@ class ObjectLiteralExpr final
11811180
return Bits.ObjectLiteralExpr.HasTrailingClosure;
11821181
}
11831182

1184-
Expr *getSemanticExpr() const { return SemanticExpr; }
1185-
void setSemanticExpr(Expr *expr) { SemanticExpr = expr; }
1186-
11871183
SourceLoc getSourceLoc() const { return PoundLoc; }
11881184
SourceRange getSourceRange() const {
11891185
return SourceRange(PoundLoc, Arg->getEndLoc());

lib/AST/ASTDumper.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,6 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
19771977
printArgumentLabels(E->getArgumentLabels());
19781978
OS << "\n";
19791979
printRec(E->getArg());
1980-
printSemanticExpr(E->getSemanticExpr());
19811980
PrintWithColorRAII(OS, ParenthesisColor) << ')';
19821981
}
19831982

lib/AST/ASTWalker.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,6 @@ class Traversal : public ASTVisitor<Traversal, Expr*, Stmt*,
484484
}
485485

486486
Expr *visitObjectLiteralExpr(ObjectLiteralExpr *E) {
487-
HANDLE_SEMANTIC_EXPR(E);
488-
489487
if (Expr *arg = E->getArg()) {
490488
if (Expr *arg2 = doIt(arg)) {
491489
E->setArg(arg2);

lib/AST/Expr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,6 @@ shallowCloneImpl(const ObjectLiteralExpr *E, ASTContext &Ctx,
839839
auto res =
840840
ObjectLiteralExpr::create(Ctx, E->getStartLoc(), E->getLiteralKind(),
841841
E->getArg(), E->isImplicit(), getType);
842-
res->setSemanticExpr(E->getSemanticExpr());
843842
return res;
844843
}
845844

@@ -1196,7 +1195,7 @@ ObjectLiteralExpr::ObjectLiteralExpr(SourceLoc PoundLoc, LiteralKind LitKind,
11961195
bool hasTrailingClosure,
11971196
bool implicit)
11981197
: LiteralExpr(ExprKind::ObjectLiteral, implicit),
1199-
Arg(Arg), SemanticExpr(nullptr), PoundLoc(PoundLoc) {
1198+
Arg(Arg), PoundLoc(PoundLoc) {
12001199
Bits.ObjectLiteralExpr.LitKind = static_cast<unsigned>(LitKind);
12011200
assert(getLiteralKind() == LitKind);
12021201
Bits.ObjectLiteralExpr.NumArgLabels = argLabels.size();

lib/Sema/CSGen.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3299,8 +3299,6 @@ namespace {
32993299
// Remove any semantic expression injected by typechecking.
33003300
if (auto ISLE = dyn_cast<InterpolatedStringLiteralExpr>(expr)) {
33013301
ISLE->setSemanticExpr(nullptr);
3302-
} else if (auto OLE = dyn_cast<ObjectLiteralExpr>(expr)) {
3303-
OLE->setSemanticExpr(nullptr);
33043302
} else if (auto EPE = dyn_cast<EditorPlaceholderExpr>(expr)) {
33053303
EPE->setSemanticExpr(nullptr);
33063304
}

0 commit comments

Comments
 (0)