Skip to content

Commit 5afe2f9

Browse files
committed
[NFC] Move ImportKind to a new Import.h header
1 parent b2fa269 commit 5afe2f9

File tree

3 files changed

+41
-15
lines changed

3 files changed

+41
-15
lines changed

include/swift/AST/Decl.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,21 +1457,6 @@ class GenericContext : private _GenericContext, public DeclContext {
14571457
static_assert(sizeof(_GenericContext) + sizeof(DeclContext) ==
14581458
sizeof(GenericContext), "Please add fields to _GenericContext");
14591459

1460-
/// Describes what kind of name is being imported.
1461-
///
1462-
/// If the enumerators here are changed, make sure to update all diagnostics
1463-
/// using ImportKind as a select index.
1464-
enum class ImportKind : uint8_t {
1465-
Module = 0,
1466-
Type,
1467-
Struct,
1468-
Class,
1469-
Enum,
1470-
Protocol,
1471-
Var,
1472-
Func
1473-
};
1474-
14751460
/// ImportDecl - This represents a single import declaration, e.g.:
14761461
/// import Swift
14771462
/// import typealias Swift.Int

include/swift/AST/Import.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//===-- Import.h - Representation of imports --------------------*- C++ -*-===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
///
13+
/// \file
14+
/// This file contains types used to represent information about imports
15+
/// throughout the AST.
16+
///
17+
//===----------------------------------------------------------------------===//
18+
19+
#ifndef SWIFT_IMPORT_H
20+
#define SWIFT_IMPORT_H
21+
22+
namespace swift {
23+
/// Describes what kind of name is being imported.
24+
///
25+
/// If the enumerators here are changed, make sure to update all diagnostics
26+
/// using ImportKind as a select index.
27+
enum class ImportKind : uint8_t {
28+
Module = 0,
29+
Type,
30+
Struct,
31+
Class,
32+
Enum,
33+
Protocol,
34+
Var,
35+
Func
36+
};
37+
38+
}
39+
40+
#endif

include/swift/AST/Module.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "swift/AST/Decl.h"
2121
#include "swift/AST/DeclContext.h"
2222
#include "swift/AST/Identifier.h"
23+
#include "swift/AST/Import.h"
2324
#include "swift/AST/LookupKinds.h"
2425
#include "swift/AST/RawComment.h"
2526
#include "swift/AST/Type.h"

0 commit comments

Comments
 (0)