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

This commit is contained in:
Xi Ge
2019-09-01 09:12:02 -07:00
parent 12b33f6530
commit cc6a246deb
8 changed files with 97 additions and 20 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);
}