HomePhabricator

Add MachineModuleInfo constructor with external MCContext

Authored by hgreving on Nov 11 2020, 5:56 PM.

Description

Add MachineModuleInfo constructor with external MCContext

Adds a constructor to MachineModuleInfo and MachineModuleInfoWapperPass that
takes an external MCContext. If provided, the external context will be used
throughout codegen instead of MMI's default one.

This enables external drivers to take ownership of data put on the MMI's context
during codegen. The internal context is used otherwise and destroyed upon
finish.

Differential Revision: https://reviews.llvm.org/D91313