anza-xyz / move

Move compiler targeting llvm supported backends
https://discord.gg/wFgfjG9J
Apache License 2.0
107 stars 32 forks source link

Refactor rtty context to include a ref to global env instead module #373

Closed dmakarov closed 10 months ago

dmakarov commented 10 months ago

Motivation

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.

Test Plan

Non-functional change, no new tests added.