mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[serialization] Sprinkle PrettyStackTrace throughout deserialization code.
Since we don't have soft-failure yet from deserialization, it's helpful to at least know where to start looking when something crashes. There are some rough edges here but it should be much better than nothing. This also pulls the list of record nodes out into a separate file, so that we can avoid repeating it. Example crash: 1. While reading from ./CTypes.swiftmodule 2. While deserializing 'CBool' (StructDecl) 3. While deserializing decl #26 (XREF) 4. Cross-reference to 'LogicValue' in swift (don't worry, this is an example where I'm tweaking things) <rdar://problem/14838332> Swift SVN r11057
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
///
|
||||
/// \file Contains various constants and helper types to deal with serialized
|
||||
/// \file
|
||||
/// \brief Contains various constants and helper types to deal with serialized
|
||||
/// modules.
|
||||
///
|
||||
//===----------------------------------------------------------------------===//
|
||||
@@ -303,75 +304,9 @@ namespace decls_block {
|
||||
// These IDs must \em not be renumbered or reordered without incrementing
|
||||
// VERSION_MAJOR.
|
||||
enum RecordKind : uint8_t {
|
||||
NAME_ALIAS_TYPE = 1,
|
||||
GENERIC_TYPE_PARAM_TYPE,
|
||||
ASSOCIATED_TYPE_TYPE,
|
||||
DEPENDENT_MEMBER_TYPE,
|
||||
NOMINAL_TYPE,
|
||||
PAREN_TYPE,
|
||||
TUPLE_TYPE,
|
||||
TUPLE_TYPE_ELT,
|
||||
FUNCTION_TYPE,
|
||||
METATYPE_TYPE,
|
||||
LVALUE_TYPE,
|
||||
ARCHETYPE_TYPE,
|
||||
ARCHETYPE_NESTED_TYPE_NAMES,
|
||||
ARCHETYPE_NESTED_TYPES,
|
||||
PROTOCOL_COMPOSITION_TYPE,
|
||||
SUBSTITUTED_TYPE,
|
||||
BOUND_GENERIC_TYPE,
|
||||
BOUND_GENERIC_SUBSTITUTION,
|
||||
POLYMORPHIC_FUNCTION_TYPE,
|
||||
GENERIC_FUNCTION_TYPE,
|
||||
ARRAY_SLICE_TYPE,
|
||||
ARRAY_TYPE,
|
||||
REFERENCE_STORAGE_TYPE,
|
||||
UNBOUND_GENERIC_TYPE,
|
||||
OPTIONAL_TYPE,
|
||||
SIL_FUNCTION_TYPE,
|
||||
|
||||
TYPE_ALIAS_DECL = 100,
|
||||
GENERIC_TYPE_PARAM_DECL,
|
||||
ASSOCIATED_TYPE_DECL,
|
||||
STRUCT_DECL,
|
||||
CONSTRUCTOR_DECL,
|
||||
VAR_DECL,
|
||||
FUNC_DECL,
|
||||
PATTERN_BINDING_DECL,
|
||||
PROTOCOL_DECL,
|
||||
PREFIX_OPERATOR_DECL,
|
||||
POSTFIX_OPERATOR_DECL,
|
||||
INFIX_OPERATOR_DECL,
|
||||
CLASS_DECL,
|
||||
ENUM_DECL,
|
||||
ENUM_ELEMENT_DECL,
|
||||
SUBSCRIPT_DECL,
|
||||
EXTENSION_DECL,
|
||||
DESTRUCTOR_DECL,
|
||||
KNOWN_PROTOCOL,
|
||||
|
||||
PAREN_PATTERN = 200,
|
||||
TUPLE_PATTERN,
|
||||
TUPLE_PATTERN_ELT,
|
||||
NAMED_PATTERN,
|
||||
ANY_PATTERN,
|
||||
TYPED_PATTERN,
|
||||
ISA_PATTERN,
|
||||
NOMINAL_TYPE_PATTERN,
|
||||
NOMINAL_TYPE_PATTERN_ELT,
|
||||
VAR_PATTERN,
|
||||
|
||||
GENERIC_PARAM_LIST = 240,
|
||||
GENERIC_PARAM,
|
||||
GENERIC_REQUIREMENT,
|
||||
LAST_GENERIC_REQUIREMENT,
|
||||
|
||||
NO_CONFORMANCE = 250,
|
||||
NORMAL_PROTOCOL_CONFORMANCE = 251,
|
||||
SPECIALIZED_PROTOCOL_CONFORMANCE = 252,
|
||||
INHERITED_PROTOCOL_CONFORMANCE = 253,
|
||||
DECL_CONTEXT = 254,
|
||||
XREF = 255
|
||||
#define RECORD(Id) Id,
|
||||
#define RECORD_VAL(Id, Value) Id = Value,
|
||||
#include "DeclTypeRecordNodes.def"
|
||||
};
|
||||
|
||||
using NameAliasTypeLayout = BCRecordLayout<
|
||||
|
||||
Reference in New Issue
Block a user