From ae2fa770e1c37d959ff7bf414725f1c7615a5546 Mon Sep 17 00:00:00 2001
From: Eric Christopher <echristo@gmail.com>
Date: Sat, 20 Jun 2020 00:51:18 -0700
Subject: [PATCH] [docs/examples] As part of using inclusive language within
 the llvm project, migrate away from the use of blacklist and whitelist.

---
 llvm/docs/HowToAddABuilder.rst                |  2 +-
 llvm/docs/ORCv2.rst                           | 10 +++++-----
 llvm/docs/Proposals/GitHubMove.rst            |  4 ++--
 llvm/docs/Statepoints.rst                     |  2 +-
 .../OrcV2CBindingsReflectProcessSymbols.c     | 20 +++++++++----------
 5 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/llvm/docs/HowToAddABuilder.rst b/llvm/docs/HowToAddABuilder.rst
index 6912d2c14b6b..a30073d92510 100644
--- a/llvm/docs/HowToAddABuilder.rst
+++ b/llvm/docs/HowToAddABuilder.rst
@@ -91,7 +91,7 @@ Here are the steps you can follow to do so:
    Please make sure your builder name and its builddir are unique through the
    file.
 
-   It is possible to whitelist email addresses to unconditionally receive
+   It is possible to allow email addresses to unconditionally receive
    notifications on build failure; for this you'll need to add an
    ``InformativeMailNotifier`` to ``buildbot/osuosl/master/config/status.py``.
    This is particularly useful for the staging buildmaster which is silent
diff --git a/llvm/docs/ORCv2.rst b/llvm/docs/ORCv2.rst
index f5a07e6d5211..5257ba9d9203 100644
--- a/llvm/docs/ORCv2.rst
+++ b/llvm/docs/ORCv2.rst
@@ -729,7 +729,7 @@ For example, to load the whole interface of a runtime library:
     // at '/path/to/lib'.
     CompileLayer.add(JD, loadModule(...));
 
-Or, to expose a whitelisted set of symbols from the main process:
+Or, to expose a allowed set of symbols from the main process:
 
   .. code-block:: c++
 
@@ -738,20 +738,20 @@ Or, to expose a whitelisted set of symbols from the main process:
 
     auto &JD = ES.createJITDylib("main");
 
-    DenseSet<SymbolStringPtr> Whitelist({
+    DenseSet<SymbolStringPtr> AllowList({
         Mangle("puts"),
         Mangle("gets")
       });
 
     // Use GetForCurrentProcess with a predicate function that checks the
-    // whitelist.
+    // allowed list.
     JD.setGenerator(
       DynamicLibrarySearchGenerator::GetForCurrentProcess(
         DL.getGlobalPrefix(),
-        [&](const SymbolStringPtr &S) { return Whitelist.count(S); }));
+        [&](const SymbolStringPtr &S) { return AllowList.count(S); }));
 
     // IR added to JD can now link against any symbols exported by the process
-    // and contained in the whitelist.
+    // and contained in the list.
     CompileLayer.add(JD, loadModule(...));
 
 Future Features
diff --git a/llvm/docs/Proposals/GitHubMove.rst b/llvm/docs/Proposals/GitHubMove.rst
index 858f88a84d8b..d11dbe260c5c 100644
--- a/llvm/docs/Proposals/GitHubMove.rst
+++ b/llvm/docs/Proposals/GitHubMove.rst
@@ -141,9 +141,9 @@ Unfortunately, GitHub does not support server side hooks to enforce such a
 policy.  We must rely on the community to avoid pushing merge commits.
 
 GitHub offers a feature called `Status Checks`: a branch protected by
-`status checks` requires commits to be whitelisted before the push can happen.
+`status checks` requires commits to be explicitly allowed before the push can happen.
 We could supply a pre-push hook on the client side that would run and check the
-history, before whitelisting the commit being pushed [statuschecks]_.
+history, before allowing the commit being pushed [statuschecks]_.
 However this solution would be somewhat fragile (how do you update a script
 installed on every developer machine?) and prevents SVN access to the
 repository.
diff --git a/llvm/docs/Statepoints.rst b/llvm/docs/Statepoints.rst
index 034cbff65c95..f55445a1063c 100644
--- a/llvm/docs/Statepoints.rst
+++ b/llvm/docs/Statepoints.rst
@@ -772,7 +772,7 @@ relocation sequence, including all required ``gc.relocates``.
 
 Note that by default, this pass only runs for the "statepoint-example" or 
 "core-clr" gc strategies.  You will need to add your custom strategy to this 
-whitelist or use one of the predefined ones. 
+list or use one of the predefined ones. 
 
 As an example, given this code:
 
diff --git a/llvm/examples/OrcV2Examples/OrcV2CBindingsReflectProcessSymbols/OrcV2CBindingsReflectProcessSymbols.c b/llvm/examples/OrcV2Examples/OrcV2CBindingsReflectProcessSymbols/OrcV2CBindingsReflectProcessSymbols.c
index a9c65103c2c6..790f153260ee 100644
--- a/llvm/examples/OrcV2Examples/OrcV2CBindingsReflectProcessSymbols/OrcV2CBindingsReflectProcessSymbols.c
+++ b/llvm/examples/OrcV2Examples/OrcV2CBindingsReflectProcessSymbols/OrcV2CBindingsReflectProcessSymbols.c
@@ -27,14 +27,14 @@ int32_t add(int32_t X, int32_t Y) { return X + Y; }
 
 int32_t mul(int32_t X, int32_t Y) { return X * Y; }
 
-int whitelistedSymbols(LLVMOrcSymbolStringPoolEntryRef Sym, void *Ctx) {
-  assert(Ctx && "Cannot call whitelistedSymbols with a null context");
+int allowedSymbols(LLVMOrcSymbolStringPoolEntryRef Sym, void *Ctx) {
+  assert(Ctx && "Cannot call allowedSymbols with a null context");
 
-  LLVMOrcSymbolStringPoolEntryRef *Whitelist =
+  LLVMOrcSymbolStringPoolEntryRef *AllowList =
       (LLVMOrcSymbolStringPoolEntryRef *)Ctx;
 
-  // If Sym appears in the whitelist then return true.
-  LLVMOrcSymbolStringPoolEntryRef *P = Whitelist;
+  // If Sym appears in the allowed list then return true.
+  LLVMOrcSymbolStringPoolEntryRef *P = AllowList;
   while (*P) {
     if (Sym == *P)
       return 1;
@@ -134,11 +134,11 @@ int main(int argc, char *argv[]) {
     }
   }
 
-  // Build a filter to allow JIT'd code to only access whitelisted symbols.
+  // Build a filter to allow JIT'd code to only access allowed symbols.
   // This filter is optional: If a null value is suppled for the Filter
   // argument to LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess then
   // all process symbols will be reflected.
-  LLVMOrcSymbolStringPoolEntryRef Whitelist[] = {
+  LLVMOrcSymbolStringPoolEntryRef AllowList[] = {
       LLVMOrcLLJITMangleAndIntern(J, "mul"),
       LLVMOrcLLJITMangleAndIntern(J, "add"), 0};
 
@@ -147,7 +147,7 @@ int main(int argc, char *argv[]) {
     LLVMErrorRef Err;
     if ((Err = LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(
              &ProcessSymbolsGenerator, LLVMOrcLLJITGetGlobalPrefix(J),
-             whitelistedSymbols, Whitelist))) {
+             allowedSymbols, AllowList))) {
       MainResult = handleError(Err);
       goto jit_cleanup;
     }
@@ -192,9 +192,9 @@ int main(int argc, char *argv[]) {
 
 jit_cleanup:
   // Release all symbol string pool entries that we have allocated. In this
-  // example that's just our whitelist entries.
+  // example that's just our allowed entries.
   {
-    LLVMOrcSymbolStringPoolEntryRef *P = Whitelist;
+    LLVMOrcSymbolStringPoolEntryRef *P = AllowList;
     while (*P)
       LLVMOrcReleaseSymbolStringPoolEntry(*P++);
   }