Merge pull request #22158 from pschuh/s-2

NilLiteralExpr now is lowered directly into SIL.
This commit is contained in:
Slava Pestov
2019-01-28 15:40:10 -05:00
committed by GitHub
6 changed files with 28 additions and 24 deletions

View File

@@ -711,6 +711,7 @@ public:
///
class NilLiteralExpr : public LiteralExpr {
SourceLoc Loc;
ConcreteDeclRef Initializer;
public:
NilLiteralExpr(SourceLoc Loc, bool Implicit = false)
: LiteralExpr(ExprKind::NilLiteral, Implicit), Loc(Loc) {
@@ -719,6 +720,15 @@ public:
SourceRange getSourceRange() const {
return Loc;
}
/// Retrieve the initializer that will be used to construct the 'nil'
/// literal from the result of the initializer.
ConcreteDeclRef getInitializer() const { return Initializer; }
/// Set the initializer that will be used to construct the 'nil' literal.
void setInitializer(ConcreteDeclRef initializer) {
Initializer = initializer;
}
static bool classof(const Expr *E) {
return E->getKind() == ExprKind::NilLiteral;