Skip to content

Commit 103b61c

Browse files
committed
ABIChecker: rename argument -protocol-requirement-white-list to -protocol-requirement-allow-list
1 parent b07ecb9 commit 103b61c

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

test/api-digester/compare-clang-dump.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %empty-directory(%t.module-cache)
44
// RUN: %api-digester -dump-sdk -module Foo -o %t.dump1.json -module-cache-path %t.module-cache %clang-importer-sdk-nosource -I %S/Inputs/Foo -avoid-location
55
// RUN: %api-digester -dump-sdk -module Foo -o %t.dump2.json -module-cache-path %t.module-cache %clang-importer-sdk-nosource -I %S/Inputs/Foo-new-version -avoid-location
6-
// RUN: %api-digester -diagnose-sdk -protocol-requirement-white-list %S/Inputs/Foo-prot-allowlist.txt -print-module --input-paths %t.dump1.json -input-paths %t.dump2.json -o %t.result
6+
// RUN: %api-digester -diagnose-sdk -protocol-requirement-allow-list %S/Inputs/Foo-prot-allowlist.txt -print-module --input-paths %t.dump1.json -input-paths %t.dump2.json -o %t.result
77

88
// RUN: %clang -E -P -x c %S/Outputs/Foo-diff.txt -o - | sed '/^\s*$/d' > %t.expected
99
// RUN: %clang -E -P -x c %t.result -o - | sed '/^\s*$/d' > %t.result.tmp

tools/swift-api-digester/swift-api-digester.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ ModuleList("module-list-file",
7272
llvm::cl::cat(Category));
7373

7474
static llvm::cl::opt<std::string>
75-
ProtReqWhiteList("protocol-requirement-white-list",
75+
ProtReqAllowList("protocol-requirement-allow-list",
7676
llvm::cl::desc("File containing a new-line separated list of protocol names"),
7777
llvm::cl::cat(Category));
7878

@@ -1074,7 +1074,7 @@ class PrunePass : public MatchedNodeListener, public SDKTreeDiffPass {
10741074

10751075
SDKContext &Ctx;
10761076
UpdatedNodesMap &UpdateMap;
1077-
llvm::StringSet<> ProtocolReqWhitelist;
1077+
llvm::StringSet<> ProtocolReqAllowlist;
10781078
SDKNodeRoot *LeftRoot;
10791079
SDKNodeRoot *RightRoot;
10801080

@@ -1123,10 +1123,10 @@ class PrunePass : public MatchedNodeListener, public SDKTreeDiffPass {
11231123

11241124
public:
11251125
PrunePass(SDKContext &Ctx): Ctx(Ctx), UpdateMap(Ctx.getNodeUpdateMap()) {}
1126-
PrunePass(SDKContext &Ctx, llvm::StringSet<> prWhitelist):
1126+
PrunePass(SDKContext &Ctx, llvm::StringSet<> prAllowlist):
11271127
Ctx(Ctx),
11281128
UpdateMap(Ctx.getNodeUpdateMap()),
1129-
ProtocolReqWhitelist(std::move(prWhitelist)) {}
1129+
ProtocolReqAllowlist(std::move(prAllowlist)) {}
11301130

11311131
void diagnoseMissingAvailable(SDKNodeDecl *D) {
11321132
// For extensions of external types, we diagnose individual member's missing
@@ -1178,7 +1178,7 @@ class PrunePass : public MatchedNodeListener, public SDKTreeDiffPass {
11781178
ShouldComplain = false;
11791179
}
11801180
if (ShouldComplain &&
1181-
ProtocolReqWhitelist.count(getParentProtocolName(D))) {
1181+
ProtocolReqAllowlist.count(getParentProtocolName(D))) {
11821182
// Ignore protocol requirement additions if the protocol has been added
11831183
// to the allowlist.
11841184
ShouldComplain = false;
@@ -2311,7 +2311,7 @@ createDiagConsumer(llvm::raw_ostream &OS, bool &FailOnError) {
23112311

23122312
static int diagnoseModuleChange(SDKContext &Ctx, SDKNodeRoot *LeftModule,
23132313
SDKNodeRoot *RightModule, StringRef OutputPath,
2314-
llvm::StringSet<> ProtocolReqWhitelist) {
2314+
llvm::StringSet<> ProtocolReqAllowlist) {
23152315
assert(LeftModule);
23162316
assert(RightModule);
23172317
llvm::raw_ostream *OS = &llvm::errs();
@@ -2334,7 +2334,7 @@ static int diagnoseModuleChange(SDKContext &Ctx, SDKNodeRoot *LeftModule,
23342334
RightModule->getJsonFormatVersion()));
23352335
TypeAliasDiffFinder(LeftModule, RightModule,
23362336
Ctx.getTypeAliasUpdateMap()).search();
2337-
PrunePass Prune(Ctx, std::move(ProtocolReqWhitelist));
2337+
PrunePass Prune(Ctx, std::move(ProtocolReqAllowlist));
23382338
Prune.pass(LeftModule, RightModule);
23392339
ChangeRefinementPass RefinementPass(Ctx.getNodeUpdateMap());
23402340
RefinementPass.pass(LeftModule, RightModule);
@@ -2347,7 +2347,7 @@ static int diagnoseModuleChange(SDKContext &Ctx, SDKNodeRoot *LeftModule,
23472347
static int diagnoseModuleChange(StringRef LeftPath, StringRef RightPath,
23482348
StringRef OutputPath,
23492349
CheckerOptions Opts,
2350-
llvm::StringSet<> ProtocolReqWhitelist) {
2350+
llvm::StringSet<> ProtocolReqAllowlist) {
23512351
if (!fs::exists(LeftPath)) {
23522352
llvm::errs() << LeftPath << " does not exist\n";
23532353
return 1;
@@ -2362,7 +2362,7 @@ static int diagnoseModuleChange(StringRef LeftPath, StringRef RightPath,
23622362
SwiftDeclCollector RightCollector(Ctx);
23632363
RightCollector.deSerialize(RightPath);
23642364
diagnoseModuleChange(Ctx, LeftCollector.getSDKRoot(), RightCollector.getSDKRoot(),
2365-
OutputPath, std::move(ProtocolReqWhitelist));
2365+
OutputPath, std::move(ProtocolReqAllowlist));
23662366
return options::CompilerStyleDiags && Ctx.getDiags().hadAnyError() ? 1 : 0;
23672367
}
23682368

@@ -2837,9 +2837,9 @@ int main(int argc, char *argv[]) {
28372837
case ActionType::MigratorGen:
28382838
case ActionType::DiagnoseSDKs: {
28392839
ComparisonInputMode Mode = checkComparisonInputMode();
2840-
llvm::StringSet<> protocolWhitelist;
2841-
if (!options::ProtReqWhiteList.empty()) {
2842-
if (readFileLineByLine(options::ProtReqWhiteList, protocolWhitelist))
2840+
llvm::StringSet<> protocolAllowlist;
2841+
if (!options::ProtReqAllowList.empty()) {
2842+
if (readFileLineByLine(options::ProtReqAllowList, protocolAllowlist))
28432843
return 1;
28442844
}
28452845
if (options::Action == ActionType::MigratorGen) {
@@ -2853,21 +2853,21 @@ int main(int argc, char *argv[]) {
28532853
return diagnoseModuleChange(options::SDKJsonPaths[0],
28542854
options::SDKJsonPaths[1],
28552855
options::OutputFile, Opts,
2856-
std::move(protocolWhitelist));
2856+
std::move(protocolAllowlist));
28572857
}
28582858
case ComparisonInputMode::BaselineJson: {
28592859
SDKContext Ctx(Opts);
28602860
return diagnoseModuleChange(Ctx, getBaselineFromJson(argv[0], Ctx),
28612861
getSDKRoot(argv[0], Ctx, false),
28622862
options::OutputFile,
2863-
std::move(protocolWhitelist));
2863+
std::move(protocolAllowlist));
28642864
}
28652865
case ComparisonInputMode::BothLoad: {
28662866
SDKContext Ctx(Opts);
28672867
return diagnoseModuleChange(Ctx, getSDKRoot(argv[0], Ctx, true),
28682868
getSDKRoot(argv[0], Ctx, false),
28692869
options::OutputFile,
2870-
std::move(protocolWhitelist));
2870+
std::move(protocolAllowlist));
28712871
}
28722872
}
28732873
}

0 commit comments

Comments
 (0)