Skip to content

Commit ae2fa77

Browse files
committed
[docs/examples] As part of using inclusive language within the llvm
project, migrate away from the use of blacklist and whitelist.
1 parent 10563e1 commit ae2fa77

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

llvm/docs/HowToAddABuilder.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Here are the steps you can follow to do so:
9191
Please make sure your builder name and its builddir are unique through the
9292
file.
9393

94-
It is possible to whitelist email addresses to unconditionally receive
94+
It is possible to allow email addresses to unconditionally receive
9595
notifications on build failure; for this you'll need to add an
9696
``InformativeMailNotifier`` to ``buildbot/osuosl/master/config/status.py``.
9797
This is particularly useful for the staging buildmaster which is silent

llvm/docs/ORCv2.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ For example, to load the whole interface of a runtime library:
729729
// at '/path/to/lib'.
730730
CompileLayer.add(JD, loadModule(...));
731731

732-
Or, to expose a whitelisted set of symbols from the main process:
732+
Or, to expose a allowed set of symbols from the main process:
733733

734734
.. code-block:: c++
735735

@@ -738,20 +738,20 @@ Or, to expose a whitelisted set of symbols from the main process:
738738

739739
auto &JD = ES.createJITDylib("main");
740740

741-
DenseSet<SymbolStringPtr> Whitelist({
741+
DenseSet<SymbolStringPtr> AllowList({
742742
Mangle("puts"),
743743
Mangle("gets")
744744
});
745745

746746
// Use GetForCurrentProcess with a predicate function that checks the
747-
// whitelist.
747+
// allowed list.
748748
JD.setGenerator(
749749
DynamicLibrarySearchGenerator::GetForCurrentProcess(
750750
DL.getGlobalPrefix(),
751-
[&](const SymbolStringPtr &S) { return Whitelist.count(S); }));
751+
[&](const SymbolStringPtr &S) { return AllowList.count(S); }));
752752

753753
// IR added to JD can now link against any symbols exported by the process
754-
// and contained in the whitelist.
754+
// and contained in the list.
755755
CompileLayer.add(JD, loadModule(...));
756756

757757
Future Features

llvm/docs/Proposals/GitHubMove.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ Unfortunately, GitHub does not support server side hooks to enforce such a
141141
policy. We must rely on the community to avoid pushing merge commits.
142142

143143
GitHub offers a feature called `Status Checks`: a branch protected by
144-
`status checks` requires commits to be whitelisted before the push can happen.
144+
`status checks` requires commits to be explicitly allowed before the push can happen.
145145
We could supply a pre-push hook on the client side that would run and check the
146-
history, before whitelisting the commit being pushed [statuschecks]_.
146+
history, before allowing the commit being pushed [statuschecks]_.
147147
However this solution would be somewhat fragile (how do you update a script
148148
installed on every developer machine?) and prevents SVN access to the
149149
repository.

llvm/docs/Statepoints.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ relocation sequence, including all required ``gc.relocates``.
772772

773773
Note that by default, this pass only runs for the "statepoint-example" or
774774
"core-clr" gc strategies. You will need to add your custom strategy to this
775-
whitelist or use one of the predefined ones.
775+
list or use one of the predefined ones.
776776

777777
As an example, given this code:
778778

llvm/examples/OrcV2Examples/OrcV2CBindingsReflectProcessSymbols/OrcV2CBindingsReflectProcessSymbols.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ int32_t add(int32_t X, int32_t Y) { return X + Y; }
2727

2828
int32_t mul(int32_t X, int32_t Y) { return X * Y; }
2929

30-
int whitelistedSymbols(LLVMOrcSymbolStringPoolEntryRef Sym, void *Ctx) {
31-
assert(Ctx && "Cannot call whitelistedSymbols with a null context");
30+
int allowedSymbols(LLVMOrcSymbolStringPoolEntryRef Sym, void *Ctx) {
31+
assert(Ctx && "Cannot call allowedSymbols with a null context");
3232

33-
LLVMOrcSymbolStringPoolEntryRef *Whitelist =
33+
LLVMOrcSymbolStringPoolEntryRef *AllowList =
3434
(LLVMOrcSymbolStringPoolEntryRef *)Ctx;
3535

36-
// If Sym appears in the whitelist then return true.
37-
LLVMOrcSymbolStringPoolEntryRef *P = Whitelist;
36+
// If Sym appears in the allowed list then return true.
37+
LLVMOrcSymbolStringPoolEntryRef *P = AllowList;
3838
while (*P) {
3939
if (Sym == *P)
4040
return 1;
@@ -134,11 +134,11 @@ int main(int argc, char *argv[]) {
134134
}
135135
}
136136

137-
// Build a filter to allow JIT'd code to only access whitelisted symbols.
137+
// Build a filter to allow JIT'd code to only access allowed symbols.
138138
// This filter is optional: If a null value is suppled for the Filter
139139
// argument to LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess then
140140
// all process symbols will be reflected.
141-
LLVMOrcSymbolStringPoolEntryRef Whitelist[] = {
141+
LLVMOrcSymbolStringPoolEntryRef AllowList[] = {
142142
LLVMOrcLLJITMangleAndIntern(J, "mul"),
143143
LLVMOrcLLJITMangleAndIntern(J, "add"), 0};
144144

@@ -147,7 +147,7 @@ int main(int argc, char *argv[]) {
147147
LLVMErrorRef Err;
148148
if ((Err = LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(
149149
&ProcessSymbolsGenerator, LLVMOrcLLJITGetGlobalPrefix(J),
150-
whitelistedSymbols, Whitelist))) {
150+
allowedSymbols, AllowList))) {
151151
MainResult = handleError(Err);
152152
goto jit_cleanup;
153153
}
@@ -192,9 +192,9 @@ int main(int argc, char *argv[]) {
192192

193193
jit_cleanup:
194194
// Release all symbol string pool entries that we have allocated. In this
195-
// example that's just our whitelist entries.
195+
// example that's just our allowed entries.
196196
{
197-
LLVMOrcSymbolStringPoolEntryRef *P = Whitelist;
197+
LLVMOrcSymbolStringPoolEntryRef *P = AllowList;
198198
while (*P)
199199
LLVMOrcReleaseSymbolStringPoolEntry(*P++);
200200
}

0 commit comments

Comments
 (0)