Skip to content

AST: Remove ObjectLiteralExpr::{get,set}SemanticExpr() #26112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions include/swift/AST/Expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,6 @@ class ObjectLiteralExpr final

private:
Expr *Arg;
Expr *SemanticExpr;
SourceLoc PoundLoc;
ConcreteDeclRef Initializer;

Expand Down Expand Up @@ -1181,9 +1180,6 @@ class ObjectLiteralExpr final
return Bits.ObjectLiteralExpr.HasTrailingClosure;
}

Expr *getSemanticExpr() const { return SemanticExpr; }
void setSemanticExpr(Expr *expr) { SemanticExpr = expr; }

SourceLoc getSourceLoc() const { return PoundLoc; }
SourceRange getSourceRange() const {
return SourceRange(PoundLoc, Arg->getEndLoc());
Expand Down
1 change: 0 additions & 1 deletion lib/AST/ASTDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,6 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
printArgumentLabels(E->getArgumentLabels());
OS << "\n";
printRec(E->getArg());
printSemanticExpr(E->getSemanticExpr());
PrintWithColorRAII(OS, ParenthesisColor) << ')';
}

Expand Down
2 changes: 0 additions & 2 deletions lib/AST/ASTWalker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,6 @@ class Traversal : public ASTVisitor<Traversal, Expr*, Stmt*,
}

Expr *visitObjectLiteralExpr(ObjectLiteralExpr *E) {
HANDLE_SEMANTIC_EXPR(E);

if (Expr *arg = E->getArg()) {
if (Expr *arg2 = doIt(arg)) {
E->setArg(arg2);
Expand Down
3 changes: 1 addition & 2 deletions lib/AST/Expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,6 @@ shallowCloneImpl(const ObjectLiteralExpr *E, ASTContext &Ctx,
auto res =
ObjectLiteralExpr::create(Ctx, E->getStartLoc(), E->getLiteralKind(),
E->getArg(), E->isImplicit(), getType);
res->setSemanticExpr(E->getSemanticExpr());
return res;
}

Expand Down Expand Up @@ -1196,7 +1195,7 @@ ObjectLiteralExpr::ObjectLiteralExpr(SourceLoc PoundLoc, LiteralKind LitKind,
bool hasTrailingClosure,
bool implicit)
: LiteralExpr(ExprKind::ObjectLiteral, implicit),
Arg(Arg), SemanticExpr(nullptr), PoundLoc(PoundLoc) {
Arg(Arg), PoundLoc(PoundLoc) {
Bits.ObjectLiteralExpr.LitKind = static_cast<unsigned>(LitKind);
assert(getLiteralKind() == LitKind);
Bits.ObjectLiteralExpr.NumArgLabels = argLabels.size();
Expand Down
2 changes: 0 additions & 2 deletions lib/Sema/CSGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3299,8 +3299,6 @@ namespace {
// Remove any semantic expression injected by typechecking.
if (auto ISLE = dyn_cast<InterpolatedStringLiteralExpr>(expr)) {
ISLE->setSemanticExpr(nullptr);
} else if (auto OLE = dyn_cast<ObjectLiteralExpr>(expr)) {
OLE->setSemanticExpr(nullptr);
} else if (auto EPE = dyn_cast<EditorPlaceholderExpr>(expr)) {
EPE->setSemanticExpr(nullptr);
}
Expand Down