Serialize local types and provide a lookup API

rdar://problem/18295292

Locally scoped type declarations were previously not serialized into the
module, which meant that the debugger couldn't reason about the
structure of instances of those types.

Introduce a new mangling for local types:
[file basename MD5][counter][identifier]
This allows the demangle node's data to be used directly for lookup
without having to backtrack in the debugger.

Local decls are now serialized into a LOCAL_TYPE_DECLS table in the
module, which acts as the backing hash table for looking up
[file basename MD5][counter][identifier] -> DeclID mappings.

New tests:
* swift-ide-test mode for testing the demangle/lookup/mangle lifecycle
of a module that contains local decls
* mangling
* module merging with local decls

Swift SVN r24426
This commit is contained in:
David Farler
2015-01-14 22:08:47 +00:00
parent e56448b1ee
commit fab3d491d9
44 changed files with 1177 additions and 194 deletions

View File

@@ -51,7 +51,7 @@ const uint16_t VERSION_MAJOR = 0;
/// To ensure that two separate changes don't silently get merged into one
/// in source control, you should also update the comment to briefly
/// describe what change you made.
const uint16_t VERSION_MINOR = 166; // Last change: non-native owning addressor
const uint16_t VERSION_MINOR = 167; // Last change: local type serialization
using DeclID = Fixnum<31>;
using DeclIDField = BCFixed<31>;
@@ -1242,6 +1242,8 @@ namespace index_block {
/// Objective-C selectors to the methods/initializers/properties/etc. that
/// produce Objective-C methods.
OBJC_METHODS,
LOCAL_TYPE_DECLS,
};
using OffsetsLayout = BCGenericRecordLayout<