Start fleshing out RemoteAST's storage-offset API.

This commit is contained in:
John McCall
2016-04-26 16:21:59 -07:00
parent 590d41c00a
commit 312aa06901
4 changed files with 70 additions and 23 deletions

View File

@@ -182,12 +182,22 @@ public:
getDeclForRemoteNominalTypeDescriptor(remote::RemoteAddress address);
/// Given a type in the local AST, try to resolve the offset of its
/// property with the given name.
/// member with the given name. This supports:
///
/// This may fail by returning an empty optional. Failure may indicate
/// that an offset for the property could not be resolved, or it may
/// simply indicate that the property has a non-zero offset.
Result<uint64_t> getOffsetForProperty(Type type, StringRef propertyName);
/// - stored properties of structs
/// - stored properties of classes
/// - elements of tuples
///
/// Failure may indicate that an offset for the property could not be
/// resolved, or it may simply indicate that the property is not laid
/// out at a known offset.
///
/// If the caller has the address of type metadata for the type, it may
/// pass it in; this may allow the implementation to compute an offset in
/// situations where it otherwise cannot.
Result<uint64_t> getOffsetOfMember(Type type,
remote::RemoteAddress optMetadataAddress,
StringRef memberName);
};
} // end namespace remoteAST