RttyContex uses module environment only to get a reference to global environment. Instead of constructing an RttyContext with a reference to module environment, construct it to include a reference to global environment directly. This eliminates dependency on ModuleEnv in RttyContext and makes it possible to be used when no ModuleEnv exists, for example to generate a completely new LLVM module from scratch without an existing Move Model Module. This is needed to generate entrypoint glue code as a separate LLVM module.
Motivation
RttyContex
uses module environment only to get a reference to global environment. Instead of constructing anRttyContext
with a reference to module environment, construct it to include a reference to global environment directly. This eliminates dependency onModuleEnv
inRttyContext
and makes it possible to be used when noModuleEnv
exists, for example to generate a completely new LLVM module from scratch without an existing Move Model Module. This is needed to generate entrypoint glue code as a separate LLVM module.Test Plan
Non-functional change, no new tests added.