In the example code for Chapter 4, we found:
cpp // EPC: Expected<std::unique_ptr<...>> auto EPC = SelfExecutorProcessControl::Create(); // ... auto ES = std::make_unique<ExecutionSession>(std::move(*EPC)); // EPC is moved here // ... JITTargetMachineBuilder JTMB((*EPC)->getTargetTriple()); // invalid access
But in KaleidoscopeJIT Chapter 1,2,3 and the include file outside the chapter, this part is
cpp JITTargetMachineBuilder JTMB( ES->getExecutorProcessControl().getTargetTriple()); // access from the owner