Files
swift-mirror/include/swift/AST/DefaultArgumentKind.h
Azoy 6f7d20b99e Synthesize default values for memberwise init
Introduce stored property default argument kind

Fix indent

Assign nil to optionals with no initializers

Don't emit generator for stored property default arg

Fix problem with rebase

Indentation

Serialize stored property default arg text

Fix some tests

Add missing constructor in test

Print stored property's initializer expression

cleanups

preserve switch

complete_constructor

formatting

fix conflict
2019-03-13 18:57:36 -05:00

66 lines
2.0 KiB
C++

//===--- DefaultArgumentKind.h - Default Argument Kind Enum -----*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file defines the DefaultArgumentKind enumeration.
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_DEFAULTARGUMENTKIND_H
#define SWIFT_DEFAULTARGUMENTKIND_H
#include <cstdint>
namespace llvm {
class StringRef;
}
namespace swift {
class Expr;
/// Describes the kind of default argument a tuple pattern element has.
enum class DefaultArgumentKind : uint8_t {
/// No default argument.
None,
/// A normal default argument.
Normal,
/// The default argument is inherited from the corresponding argument of the
/// overridden declaration.
Inherited,
/// The #file default argument, which is expanded at the call site.
File,
/// The #line default argument, which is expanded at the call site.
Line,
/// The #column default argument, which is expanded at the call site.
Column,
/// The #function default argument, which is expanded at the call site.
Function,
/// The #dsohandle default argument, which is expanded at the call site.
DSOHandle,
/// The "nil" literal.
NilLiteral,
/// An empty array literal.
EmptyArray,
/// An empty dictionary literal.
EmptyDictionary,
/// A reference to the stored property. This is a special default argument
/// kind for the synthesized memberwise constructor to emit a call to the
// property's initializer.
StoredProperty,
};
enum { NumDefaultArgumentKindBits = 4 };
} // end namespace swift
#endif // LLVM_SWIFT_DEFAULTARGUMENTKIND_H