diff --git a/clang/docs/ClangCommandLineReference.rst b/clang/docs/ClangCommandLineReference.rst --- a/clang/docs/ClangCommandLineReference.rst +++ b/clang/docs/ClangCommandLineReference.rst @@ -483,7 +483,7 @@ Enable migration to annotate property with NS\_RETURNS\_INNER\_POINTER -.. option:: -objcmt-whitelist-dir-path=, -objcmt-white-list-dir-path= +.. option:: -objcmpt-allowlist-dir-path=, -objcmt-whitelist-dir-path=, -objcmt-white-list-dir-path= Only modify files with a filename contained in the provided directory path diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -617,12 +617,15 @@ HelpText<"Enable migration to infer NS_DESIGNATED_INITIALIZER for initializer methods">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_DesignatedInitializer">; -def objcmt_whitelist_dir_path: Joined<["-"], "objcmt-whitelist-dir-path=">, Flags<[CC1Option]>, +def objcmt_allowlist_dir_path: Joined<["-"], "objcmt-allowlist-dir-path=">, Flags<[CC1Option]>, HelpText<"Only modify files with a filename contained in the provided directory path">, - MarshallingInfoString>; + MarshallingInfoString>; +def : Joined<["-"], "objcmt-whitelist-dir-path=">, Flags<[CC1Option]>, + HelpText<"Alias for -objcmt-allowlist-dir-path">, + Alias; // The misspelt "white-list" [sic] alias is due for removal. def : Joined<["-"], "objcmt-white-list-dir-path=">, Flags<[CC1Option]>, - Alias; + Alias; // Make sure all other -ccc- options are rejected. def ccc_ : Joined<["-"], "ccc-">, Group, Flags<[Unsupported]>; diff --git a/clang/include/clang/Frontend/FrontendOptions.h b/clang/include/clang/Frontend/FrontendOptions.h --- a/clang/include/clang/Frontend/FrontendOptions.h +++ b/clang/include/clang/Frontend/FrontendOptions.h @@ -373,7 +373,7 @@ ObjCMT_MigrateDecls | ObjCMT_PropertyDotSyntax) }; unsigned ObjCMTAction = ObjCMT_None; - std::string ObjCMTWhiteListPath; + std::string ObjCMTAllowListPath; std::string MTMigrateDir; std::string ARCMTMigrateReportOut; diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp --- a/clang/lib/ARCMigrate/ObjCMT.cpp +++ b/clang/lib/ARCMigrate/ObjCMT.cpp @@ -104,7 +104,7 @@ bool FoundationIncluded; llvm::SmallPtrSet ObjCProtocolDecls; llvm::SmallVector CFFunctionIBCandidates; - llvm::StringSet<> WhiteListFilenames; + llvm::StringSet<> AllowListFilenames; RetainSummaryManager &getSummaryManager(ASTContext &Ctx) { if (!Summaries) @@ -118,14 +118,14 @@ FileRemapper &remapper, FileManager &fileMgr, const PPConditionalDirectiveRecord *PPRec, Preprocessor &PP, bool isOutputFile, - ArrayRef WhiteList) + ArrayRef AllowList) : MigrateDir(migrateDir), ASTMigrateActions(astMigrateActions), NSIntegerTypedefed(nullptr), NSUIntegerTypedefed(nullptr), Remapper(remapper), FileMgr(fileMgr), PPRec(PPRec), PP(PP), IsOutputFile(isOutputFile), FoundationIncluded(false) { // FIXME: StringSet should have insert(iter, iter) to use here. - for (const std::string &Val : WhiteList) - WhiteListFilenames.insert(Val); + for (const std::string &Val : AllowList) + AllowListFilenames.insert(Val); } protected: @@ -151,10 +151,10 @@ void HandleTranslationUnit(ASTContext &Ctx) override; bool canModifyFile(StringRef Path) { - if (WhiteListFilenames.empty()) + if (AllowListFilenames.empty()) return true; - return WhiteListFilenames.find(llvm::sys::path::filename(Path)) - != WhiteListFilenames.end(); + return AllowListFilenames.find(llvm::sys::path::filename(Path)) + != AllowListFilenames.end(); } bool canModifyFile(Optional FE) { if (!FE) @@ -1986,7 +1986,7 @@ return true; } -static std::vector getWhiteListFilenames(StringRef DirPath) { +static std::vector getAllowListFilenames(StringRef DirPath) { using namespace llvm::sys::fs; using namespace llvm::sys::path; @@ -2021,12 +2021,12 @@ FrontendOptions::ObjCMT_Subscripting; } CI.getPreprocessor().addPPCallbacks(std::unique_ptr(PPRec)); - std::vector WhiteList = - getWhiteListFilenames(CI.getFrontendOpts().ObjCMTWhiteListPath); + std::vector AllowList = + getAllowListFilenames(CI.getFrontendOpts().ObjCMTAllowListPath); return std::make_unique( CI.getFrontendOpts().OutputFile, ObjCMTAction, Remapper, CI.getFileManager(), PPRec, CI.getPreprocessor(), - /*isOutputFile=*/true, WhiteList); + /*isOutputFile=*/true, AllowList); } namespace { diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -3387,7 +3387,7 @@ Args.AddLastArg(CmdArgs, options::OPT_objcmt_returns_innerpointer_property); Args.AddLastArg(CmdArgs, options::OPT_objcmt_ns_nonatomic_iosonly); Args.AddLastArg(CmdArgs, options::OPT_objcmt_migrate_designated_init); - Args.AddLastArg(CmdArgs, options::OPT_objcmt_whitelist_dir_path); + Args.AddLastArg(CmdArgs, options::OPT_objcmt_allowlist_dir_path); } } diff --git a/clang/test/ARCMT/whitelisted/Inputs/header1.h b/clang/test/ARCMT/allowlisted/Inputs/header1.h rename from clang/test/ARCMT/whitelisted/Inputs/header1.h rename to clang/test/ARCMT/allowlisted/Inputs/header1.h diff --git a/clang/test/ARCMT/whitelisted/header1.h b/clang/test/ARCMT/allowlisted/header1.h rename from clang/test/ARCMT/whitelisted/header1.h rename to clang/test/ARCMT/allowlisted/header1.h diff --git a/clang/test/ARCMT/whitelisted/header1.h.result b/clang/test/ARCMT/allowlisted/header1.h.result rename from clang/test/ARCMT/whitelisted/header1.h.result rename to clang/test/ARCMT/allowlisted/header1.h.result diff --git a/clang/test/ARCMT/whitelisted/header2.h b/clang/test/ARCMT/allowlisted/header2.h rename from clang/test/ARCMT/whitelisted/header2.h rename to clang/test/ARCMT/allowlisted/header2.h diff --git a/clang/test/ARCMT/whitelisted/header2.h.result b/clang/test/ARCMT/allowlisted/header2.h.result rename from clang/test/ARCMT/whitelisted/header2.h.result rename to clang/test/ARCMT/allowlisted/header2.h.result diff --git a/clang/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m b/clang/test/ARCMT/allowlisted/objcmt-with-allowlist-impl.m rename from clang/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m rename to clang/test/ARCMT/allowlisted/objcmt-with-allowlist-impl.m --- a/clang/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m +++ b/clang/test/ARCMT/allowlisted/objcmt-with-allowlist-impl.m @@ -1,5 +1,5 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -objcmt-white-list-dir-path=%S/Inputs %s -triple x86_64-apple-darwin11 -migrate -o %t.remap +// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -objcmt-allowlist-dir-path=%S/Inputs %s -triple x86_64-apple-darwin11 -migrate -o %t.remap // RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %S/header1.h.result %s.result @interface NSObject diff --git a/clang/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m.result b/clang/test/ARCMT/allowlisted/objcmt-with-allowlist-impl.m.result rename from clang/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m.result rename to clang/test/ARCMT/allowlisted/objcmt-with-allowlist-impl.m.result --- a/clang/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m.result +++ b/clang/test/ARCMT/allowlisted/objcmt-with-allowlist-impl.m.result @@ -1,5 +1,5 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -objcmt-white-list-dir-path=%S/Inputs %s -triple x86_64-apple-darwin11 -migrate -o %t.remap +// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -objcmt-allowlist-dir-path=%S/Inputs %s -triple x86_64-apple-darwin11 -migrate -o %t.remap // RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %S/header1.h.result %s.result @interface NSObject diff --git a/clang/test/ARCMT/whitelisted/objcmt-with-whitelist.m b/clang/test/ARCMT/allowlisted/objcmt-with-allowlist.m rename from clang/test/ARCMT/whitelisted/objcmt-with-whitelist.m rename to clang/test/ARCMT/allowlisted/objcmt-with-allowlist.m --- a/clang/test/ARCMT/whitelisted/objcmt-with-whitelist.m +++ b/clang/test/ARCMT/allowlisted/objcmt-with-allowlist.m @@ -1,7 +1,7 @@ // RUN: rm -rf %t // RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -objcmt-migrate-ns-macros %s -triple x86_64-apple-darwin11 -migrate -o %t.remap // RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %S/header1.h.result %S/header2.h.result -// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -objcmt-migrate-ns-macros -objcmt-white-list-dir-path=%S/Inputs %s -triple x86_64-apple-darwin11 -migrate -o %t.remap +// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -objcmt-migrate-ns-macros -objcmt-allowlist-dir-path=%S/Inputs %s -triple x86_64-apple-darwin11 -migrate -o %t.remap // RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %S/header1.h.result @interface NSObject diff --git a/clang/test/SemaObjC/method-conflict-1.m b/clang/test/SemaObjC/method-conflict-1.m --- a/clang/test/SemaObjC/method-conflict-1.m +++ b/clang/test/SemaObjC/method-conflict-1.m @@ -73,7 +73,7 @@ - (A*) test2 { return 0; } // broken-warning {{conflicting return type in implementation of 'test2': 'B *' vs 'A *'}} @end -// The particular case of overriding with an id return is white-listed. +// The particular case of overriding with an id return is permitted. @interface Test4 {} - (id) test1; - (A*) test2; diff --git a/clang/test/SemaObjC/method-conflict-2.m b/clang/test/SemaObjC/method-conflict-2.m --- a/clang/test/SemaObjC/method-conflict-2.m +++ b/clang/test/SemaObjC/method-conflict-2.m @@ -34,7 +34,7 @@ - (A*) test2 { return 0; } // expected-warning {{conflicting return type in implementation of 'test2': 'B *' vs 'A *'}} @end -// The particular case of overriding with an id return is white-listed. +// The particular case of overriding with an id return is permitted. @interface Test4 {} - (id) test1; - (A*) test2; diff --git a/clang/test/SemaObjC/method-typecheck-3.m b/clang/test/SemaObjC/method-typecheck-3.m --- a/clang/test/SemaObjC/method-typecheck-3.m +++ b/clang/test/SemaObjC/method-typecheck-3.m @@ -13,7 +13,7 @@ @end @implementation B -- (id)obj {return self;} // 'id' overrides are white-listed? +- (id)obj {return self;} // 'id' overrides are permitted? - (A*)a { return self;} // expected-warning {{conflicting return type in implementation of 'a'}} - (void)takesA: (B*)a // expected-warning {{conflicting parameter types in implementation of 'takesA:'}} {}