Skip to content

Commit 2c807ed

Browse files
authored
Merge pull request swiftlang#15985 from gottesmm/swift-4.2-branch-constexpr-fix
[4.2] [strliteral-upgrade] Change Strings.h constants to be constexpr static instead of static.
2 parents 8cb89a2 + 3ad0489 commit 2c807ed

File tree

1 file changed

+73
-65
lines changed

1 file changed

+73
-65
lines changed

include/swift/Strings.h

Lines changed: 73 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -14,73 +14,81 @@
1414
#define SWIFT_STRINGS_H
1515

1616
namespace swift {
17-
/// The extension for serialized modules.
18-
static const char SERIALIZED_MODULE_EXTENSION[] = "swiftmodule";
19-
/// The extension for serialized documentation comments.
20-
static const char SERIALIZED_MODULE_DOC_EXTENSION[] = "swiftdoc";
21-
/// The extension for PCH files.
22-
static const char PCH_EXTENSION[] = "pch";
23-
/// The extension for replacement map files.
24-
static const char REMAP_EXTENSION[] = "remap";
25-
/// The extension for SIL files.
26-
static const char SIL_EXTENSION[] = "sil";
27-
/// The extension for SIB files.
28-
static const char SIB_EXTENSION[] = "sib";
29-
/// The extension for LLVM IR files.
30-
static const char LLVM_BC_EXTENSION[] = "bc";
31-
static const char LLVM_IR_EXTENSION[] = "ll";
32-
/// The name of the standard library, which is a reserved module name.
33-
static const char STDLIB_NAME[] = "Swift";
34-
/// The name of the Onone support library, which is a reserved module name.
35-
static const char SWIFT_ONONE_SUPPORT[] = "SwiftOnoneSupport";
36-
/// The name of the SwiftShims module, which contains private stdlib decls.
37-
static const char SWIFT_SHIMS_NAME[] = "SwiftShims";
38-
/// The name of the Builtin module, which contains Builtin functions.
39-
static const char BUILTIN_NAME[] = "Builtin";
40-
/// The prefix of module names used by LLDB to capture Swift expressions
41-
static const char LLDB_EXPRESSIONS_MODULE_NAME_PREFIX[] = "__lldb_expr_";
4217

43-
/// The name of the fake module used to hold imported Objective-C things.
44-
static const char MANGLING_MODULE_OBJC[] = "__C";
45-
/// The name of the fake module used to hold synthesized ClangImporter things.
46-
static const char MANGLING_MODULE_CLANG_IMPORTER[] = "__C_Synthesized";
18+
/// The extension for serialized modules.
19+
constexpr static const char SERIALIZED_MODULE_EXTENSION[] = "swiftmodule";
20+
/// The extension for serialized documentation comments.
21+
constexpr static const char SERIALIZED_MODULE_DOC_EXTENSION[] = "swiftdoc";
22+
/// The extension for PCH files.
23+
constexpr static const char PCH_EXTENSION[] = "pch";
24+
/// The extension for replacement map files.
25+
constexpr static const char REMAP_EXTENSION[] = "remap";
26+
/// The extension for SIL files.
27+
constexpr static const char SIL_EXTENSION[] = "sil";
28+
/// The extension for SIB files.
29+
constexpr static const char SIB_EXTENSION[] = "sib";
30+
/// The extension for LLVM IR files.
31+
constexpr static const char LLVM_BC_EXTENSION[] = "bc";
32+
constexpr static const char LLVM_IR_EXTENSION[] = "ll";
33+
/// The name of the standard library, which is a reserved module name.
34+
constexpr static const char STDLIB_NAME[] = "Swift";
35+
/// The name of the Onone support library, which is a reserved module name.
36+
constexpr static const char SWIFT_ONONE_SUPPORT[] = "SwiftOnoneSupport";
37+
/// The name of the SwiftShims module, which contains private stdlib decls.
38+
constexpr static const char SWIFT_SHIMS_NAME[] = "SwiftShims";
39+
/// The name of the Builtin module, which contains Builtin functions.
40+
constexpr static const char BUILTIN_NAME[] = "Builtin";
41+
/// The prefix of module names used by LLDB to capture Swift expressions
42+
constexpr static const char LLDB_EXPRESSIONS_MODULE_NAME_PREFIX[] =
43+
"__lldb_expr_";
4744

48-
/// The name of the Builtin type prefix
49-
static const char BUILTIN_TYPE_NAME_PREFIX[] = "Builtin.";
50-
/// The name of the Builtin type for Int
51-
static const char BUILTIN_TYPE_NAME_INT[] = "Builtin.Int";
52-
/// The name of the Builtin type for Int8
53-
static const char BUILTIN_TYPE_NAME_INT8[] = "Builtin.Int8";
54-
/// The name of the Builtin type for Int16
55-
static const char BUILTIN_TYPE_NAME_INT16[] = "Builtin.Int16";
56-
/// The name of the Builtin type for Int32
57-
static const char BUILTIN_TYPE_NAME_INT32[] = "Builtin.Int32";
58-
/// The name of the Builtin type for Int64
59-
static const char BUILTIN_TYPE_NAME_INT64[] = "Builtin.Int64";
60-
/// The name of the Builtin type for Int128
61-
static const char BUILTIN_TYPE_NAME_INT128[] = "Builtin.Int128";
62-
/// The name of the Builtin type for Int256
63-
static const char BUILTIN_TYPE_NAME_INT256[] = "Builtin.Int256";
64-
/// The name of the Builtin type for Int512
65-
static const char BUILTIN_TYPE_NAME_INT512[] = "Builtin.Int512";
66-
/// The name of the Builtin type for Float
67-
static const char BUILTIN_TYPE_NAME_FLOAT[] = "Builtin.Float";
68-
/// The name of the Builtin type for NativeObject
69-
static const char BUILTIN_TYPE_NAME_NATIVEOBJECT[] = "Builtin.NativeObject";
70-
/// The name of the Builtin type for BridgeObject
71-
static const char BUILTIN_TYPE_NAME_BRIDGEOBJECT[] = "Builtin.BridgeObject";
72-
/// The name of the Builtin type for RawPointer
73-
static const char BUILTIN_TYPE_NAME_RAWPOINTER[] = "Builtin.RawPointer";
74-
/// The name of the Builtin type for UnsafeValueBuffer
75-
static const char BUILTIN_TYPE_NAME_UNSAFEVALUEBUFFER[] = "Builtin.UnsafeValueBuffer";
76-
/// The name of the Builtin type for UnknownObject
77-
static const char BUILTIN_TYPE_NAME_UNKNOWNOBJECT[] = "Builtin.UnknownObject";
78-
/// The name of the Builtin type for Vector
79-
static const char BUILTIN_TYPE_NAME_VEC[] = "Builtin.Vec";
80-
/// The name of the Builtin type for SILToken
81-
static const char BUILTIN_TYPE_NAME_SILTOKEN[] = "Builtin.SILToken";
82-
/// The name of the Builtin type for Word
83-
static const char BUILTIN_TYPE_NAME_WORD[] = "Builtin.Word";
45+
/// The name of the fake module used to hold imported Objective-C things.
46+
constexpr static const char MANGLING_MODULE_OBJC[] = "__C";
47+
/// The name of the fake module used to hold synthesized ClangImporter things.
48+
constexpr static const char MANGLING_MODULE_CLANG_IMPORTER[] =
49+
"__C_Synthesized";
50+
51+
/// The name of the Builtin type prefix
52+
constexpr static const char BUILTIN_TYPE_NAME_PREFIX[] = "Builtin.";
53+
/// The name of the Builtin type for Int
54+
constexpr static const char BUILTIN_TYPE_NAME_INT[] = "Builtin.Int";
55+
/// The name of the Builtin type for Int8
56+
constexpr static const char BUILTIN_TYPE_NAME_INT8[] = "Builtin.Int8";
57+
/// The name of the Builtin type for Int16
58+
constexpr static const char BUILTIN_TYPE_NAME_INT16[] = "Builtin.Int16";
59+
/// The name of the Builtin type for Int32
60+
constexpr static const char BUILTIN_TYPE_NAME_INT32[] = "Builtin.Int32";
61+
/// The name of the Builtin type for Int64
62+
constexpr static const char BUILTIN_TYPE_NAME_INT64[] = "Builtin.Int64";
63+
/// The name of the Builtin type for Int128
64+
constexpr static const char BUILTIN_TYPE_NAME_INT128[] = "Builtin.Int128";
65+
/// The name of the Builtin type for Int256
66+
constexpr static const char BUILTIN_TYPE_NAME_INT256[] = "Builtin.Int256";
67+
/// The name of the Builtin type for Int512
68+
constexpr static const char BUILTIN_TYPE_NAME_INT512[] = "Builtin.Int512";
69+
/// The name of the Builtin type for Float
70+
constexpr static const char BUILTIN_TYPE_NAME_FLOAT[] = "Builtin.Float";
71+
/// The name of the Builtin type for NativeObject
72+
constexpr static const char BUILTIN_TYPE_NAME_NATIVEOBJECT[] =
73+
"Builtin.NativeObject";
74+
/// The name of the Builtin type for BridgeObject
75+
constexpr static const char BUILTIN_TYPE_NAME_BRIDGEOBJECT[] =
76+
"Builtin.BridgeObject";
77+
/// The name of the Builtin type for RawPointer
78+
constexpr static const char BUILTIN_TYPE_NAME_RAWPOINTER[] =
79+
"Builtin.RawPointer";
80+
/// The name of the Builtin type for UnsafeValueBuffer
81+
constexpr static const char BUILTIN_TYPE_NAME_UNSAFEVALUEBUFFER[] =
82+
"Builtin.UnsafeValueBuffer";
83+
/// The name of the Builtin type for UnknownObject
84+
constexpr static const char BUILTIN_TYPE_NAME_UNKNOWNOBJECT[] =
85+
"Builtin.UnknownObject";
86+
/// The name of the Builtin type for Vector
87+
constexpr static const char BUILTIN_TYPE_NAME_VEC[] = "Builtin.Vec";
88+
/// The name of the Builtin type for SILToken
89+
constexpr static const char BUILTIN_TYPE_NAME_SILTOKEN[] = "Builtin.SILToken";
90+
/// The name of the Builtin type for Word
91+
constexpr static const char BUILTIN_TYPE_NAME_WORD[] = "Builtin.Word";
8492
} // end namespace swift
8593

8694
#endif // SWIFT_STRINGS_H

0 commit comments

Comments
 (0)