1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 10:32:48 +02:00

s/setGenerator/addGenerator/ in the JIT docs. NFC

This commit is contained in:
Jon Roelofs 2021-04-15 15:54:28 -07:00
parent 91b8e2e75a
commit 87c0b7c256
3 changed files with 6 additions and 6 deletions

View File

@ -730,7 +730,7 @@ For example, to load the whole interface of a runtime library:
const DataLayout &DL = getDataLayout(); const DataLayout &DL = getDataLayout();
auto &JD = ES.createJITDylib("main"); auto &JD = ES.createJITDylib("main");
JD.setGenerator(DynamicLibrarySearchGenerator::Load("/path/to/lib" JD.addGenerator(DynamicLibrarySearchGenerator::Load("/path/to/lib"
DL.getGlobalPrefix())); DL.getGlobalPrefix()));
// IR added to JD can now link against all symbols exported by the library // IR added to JD can now link against all symbols exported by the library
@ -753,7 +753,7 @@ Or, to expose an allowed set of symbols from the main process:
// Use GetForCurrentProcess with a predicate function that checks the // Use GetForCurrentProcess with a predicate function that checks the
// allowed list. // allowed list.
JD.setGenerator( JD.addGenerator(
DynamicLibrarySearchGenerator::GetForCurrentProcess( DynamicLibrarySearchGenerator::GetForCurrentProcess(
DL.getGlobalPrefix(), DL.getGlobalPrefix(),
[&](const SymbolStringPtr &S) { return AllowList.count(S); })); [&](const SymbolStringPtr &S) { return AllowList.count(S); }));

View File

@ -142,8 +142,8 @@ usual include guards and #includes [2]_, we get to the definition of our class:
CompileLayer(ES, ObjectLayer, ConcurrentIRCompiler(std::move(JTMB))), CompileLayer(ES, ObjectLayer, ConcurrentIRCompiler(std::move(JTMB))),
DL(std::move(DL)), Mangle(ES, this->DL), DL(std::move(DL)), Mangle(ES, this->DL),
Ctx(std::make_unique<LLVMContext>()) { Ctx(std::make_unique<LLVMContext>()) {
ES.getMainJITDylib().setGenerator( ES.getMainJITDylib().addGenerator(
cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(DL))); cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(DL.getGlobalPrefix())));
} }
Our class begins with six member variables: An ExecutionSession member, ``ES``, Our class begins with six member variables: An ExecutionSession member, ``ES``,

View File

@ -76,8 +76,8 @@ apply to each Module that is added via addModule:
TransformLayer(ES, CompileLayer, optimizeModule), TransformLayer(ES, CompileLayer, optimizeModule),
DL(std::move(DL)), Mangle(ES, this->DL), DL(std::move(DL)), Mangle(ES, this->DL),
Ctx(std::make_unique<LLVMContext>()) { Ctx(std::make_unique<LLVMContext>()) {
ES.getMainJITDylib().setGenerator( ES.getMainJITDylib().addGenerator(
cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(DL))); cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(DL.getGlobalPrefix())));
} }
Our extended KaleidoscopeJIT class starts out the same as it did in Chapter 1, Our extended KaleidoscopeJIT class starts out the same as it did in Chapter 1,