Add an MCSubtargetInfo variable to the TargetMachine.

This enables us to remove calls to the subtarget from the TargetMachine
and with a small hack for backends that require global subtarget
information for module level code generation, e.g. mips abi flags, as
mentioned in a fixme in the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232776 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2015-03-19 22:36:37 +00:00
parent d802a47f96
commit 0d6199b3af
3 changed files with 14 additions and 3 deletions

View File

@ -42,13 +42,15 @@ TargetMachine::TargetMachine(const Target &T, StringRef DataLayoutString,
const TargetOptions &Options)
: TheTarget(T), DL(DataLayoutString), TargetTriple(TT), TargetCPU(CPU),
TargetFS(FS), CodeGenInfo(nullptr), AsmInfo(nullptr), MRI(nullptr),
MII(nullptr), RequireStructuredCFG(false), Options(Options) {}
MII(nullptr), STI(nullptr), RequireStructuredCFG(false),
Options(Options) {}
TargetMachine::~TargetMachine() {
delete CodeGenInfo;
delete AsmInfo;
delete MRI;
delete MII;
delete STI;
}
/// \brief Reset the target options based on the function's attributes.