swift-api-digester: teach the tool to find framework-specific baselines from relative path

The framework baselines are installed at 'lib/swift/FrameworkABIBaseline' and the
tool is inside 'bin'. This patch teaches the executable to locate baselines
from the relative path.

In addition, this patch moves the stdlib ABI/API baselines to the canonical
location so we don't have to check the stability of the stdlib using a
different mechanism from other Swift frameworks.
This commit is contained in:
Xi Ge
2019-08-30 17:42:50 -07:00
parent 60a55646ed
commit 178e5d5ecf
7 changed files with 96 additions and 18 deletions

View File

@@ -586,8 +586,8 @@ static StringRef getKeyContent(SDKContext &Ctx, KeyKind Kind) {
SDKNode* SDKNode::constructSDKNode(SDKContext &Ctx,
llvm::yaml::MappingNode *Node) {
static auto GetScalarString = [&](llvm::yaml::Node *N) -> StringRef {
auto WithQuote = cast<llvm::yaml::ScalarNode>(N)->getRawValue();
return WithQuote.substr(1, WithQuote.size() - 2);
SmallString<64> Buffer;
return Ctx.buffer(cast<llvm::yaml::ScalarNode>(N)->getValue(Buffer));
};
static auto getAsInt = [&](llvm::yaml::Node *N) -> int {
@@ -2102,7 +2102,6 @@ static parseJsonEmit(SDKContext &Ctx, StringRef FileName) {
// previously dumped.
void SwiftDeclCollector::deSerialize(StringRef Filename) {
auto Pair = parseJsonEmit(Ctx, Filename);
OwnedBuffers.push_back(std::move(Pair.first));
RootNode = std::move(Pair.second);
}