mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Teach the Mach-O-based AST importer to accept bare serialized ASTs.
This necessitated adding a new function to validate a serialized AST, so that we can get the same information that used to be extracted from the section header. For now, we'll continue accepting the wrapped ASTs as well, since we haven't changed the existing debug info generator. Swift SVN r12922
This commit is contained in:
@@ -253,12 +253,11 @@ SerializedModuleLoader::loadDeclsConformingTo(KnownProtocolKind kind,
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
SerializedModuleLoader::isValidSerializedAST(const llvm::MemoryBuffer &input) {
|
||||
bool SerializedModuleLoader::isSerializedAST(StringRef data) {
|
||||
using serialization::SIGNATURE;
|
||||
StringRef signatureStr(reinterpret_cast<const char *>(SIGNATURE),
|
||||
llvm::array_lengthof(SIGNATURE));
|
||||
return input.getBuffer().startswith(signatureStr);
|
||||
return data.startswith(signatureStr);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user