Add MachineModuleInfo constructor with external MCContext
authorHendrik Greving <hgreving@google.com>
Thu, 12 Nov 2020 01:56:14 +0000 (17:56 -0800)
committerHendrik Greving <hgreving@google.com>
Tue, 1 Dec 2020 04:28:13 +0000 (20:28 -0800)
commitd4ba5e15f4f2f41f13625cc10e4df74b44620803
tree4c97b890ea5529867a1202aa633455cbc1ac6d9b
parent173bb3c2eb094920708ab8f61dae2fe22d331773
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
llvm/include/llvm/CodeGen/MachineModuleInfo.h
llvm/lib/CodeGen/MachineModuleInfo.cpp