mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ABI/API checker: serialized json format should include all tool invocation arguments
This commit is contained in:
@@ -79,7 +79,8 @@ void SDKNodeRoot::registerDescendant(SDKNode *D) {
|
||||
SDKNode::SDKNode(SDKNodeInitInfo Info, SDKNodeKind Kind): Ctx(Info.Ctx),
|
||||
Name(Info.Name), PrintedName(Info.PrintedName), TheKind(unsigned(Kind)) {}
|
||||
|
||||
SDKNodeRoot::SDKNodeRoot(SDKNodeInitInfo Info): SDKNode(Info, SDKNodeKind::Root) {}
|
||||
SDKNodeRoot::SDKNodeRoot(SDKNodeInitInfo Info): SDKNode(Info, SDKNodeKind::Root),
|
||||
ToolArgs(Info.ToolArgs) {}
|
||||
|
||||
SDKNodeDecl::SDKNodeDecl(SDKNodeInitInfo Info, SDKNodeKind Kind)
|
||||
: SDKNode(Info, Kind), DKind(Info.DKind), Usr(Info.Usr),
|
||||
@@ -367,6 +368,7 @@ SDKNode *SDKNodeRoot::getInstance(SDKContext &Ctx) {
|
||||
SDKNodeInitInfo Info(Ctx);
|
||||
Info.Name = Ctx.buffer("TopLevel");
|
||||
Info.PrintedName = Ctx.buffer("TopLevel");
|
||||
Info.ToolArgs = Ctx.getOpts().ToolArgs;
|
||||
return Info.createSDKNode(SDKNodeKind::Root);
|
||||
}
|
||||
|
||||
@@ -1829,6 +1831,12 @@ void SDKNode::jsonize(json::Output &out) {
|
||||
out.mapOptional(getKeyContent(Ctx, KeyKind::KK_children).data(), Children);
|
||||
}
|
||||
|
||||
void SDKNodeRoot::jsonize(json::Output &out) {
|
||||
SDKNode::jsonize(out);
|
||||
if (!Ctx.getOpts().AvoidToolArgs)
|
||||
out.mapOptional(getKeyContent(Ctx, KeyKind::KK_tool_arguments).data(), ToolArgs);
|
||||
}
|
||||
|
||||
void SDKNodeConformance::jsonize(json::Output &out) {
|
||||
SDKNode::jsonize(out);
|
||||
output(out, KeyKind::KK_usr, Usr);
|
||||
|
||||
Reference in New Issue
Block a user