mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 02:33:06 +01:00
[docs/examples] As part of using inclusive language within the llvm
project, migrate away from the use of blacklist and whitelist.
This commit is contained in:
parent
688a5b60e8
commit
26606860a8
@ -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
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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:
|
||||
|
||||
|
@ -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++);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user