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

@@ -318,14 +318,9 @@ template <> struct Failure::ArgTypesForFailureKind<Failure::KIND##_t> { \
};
#include "swift/Remote/FailureKinds.def"
template <>
struct Failure::IsAcceptableArgType<Failure::ArgType_String, const char *> {
static constexpr bool value = true;
};
template <>
struct Failure::IsAcceptableArgType<Failure::ArgType_String, std::string> {
static constexpr bool value = true;
template <class T>
struct Failure::IsAcceptableArgType<Failure::ArgType_String, T> {
static constexpr bool value = std::is_convertible<T, std::string>::value;
};
template <>

View File

@@ -13,9 +13,16 @@
// FAILURE(KIND, TEXT, ARGTYS)
FAILURE(Unknown, "an unknown failure occurred", ())
FAILURE(BadArgument, "the API was called with a bad argument", ())
FAILURE(Memory, "an unknown failure occurred while reading %0 at address %1",
(String, Address))
FAILURE(DependentArgument,
"API was called with a dependent type", ())
FAILURE(TypeHasNoSuchMember,
"type has no member named '%0'", (String))
FAILURE(CouldNotResolveTypeDecl,
"could not resolve a type with mangled name '%0'", (String))