From a063107f8d12831004583ab9c1fd70f84806a563 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Thu, 12 Oct 2017 22:28:54 +0000 Subject: TargetMachine: Merge TargetMachine and LLVMTargetMachine Merge LLVMTargetMachine into TargetMachine. - There is no in-tree target anymore that just implements TargetMachine but not LLVMTargetMachine. - It should still be possible to stub out all the various functions in case a target does not want to use lib/CodeGen - This simplifies the code and avoids methods ending up in the wrong interface. Differential Revision: https://reviews.llvm.org/D38489 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315633 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llc/llc.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tools/llc') diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index fe6b97e34b6..923095a0056 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -511,8 +511,7 @@ static int compileModule(char **argv, LLVMContext &Context) { } const char *argv0 = argv[0]; - LLVMTargetMachine &LLVMTM = static_cast(*Target); - MachineModuleInfo *MMI = new MachineModuleInfo(&LLVMTM); + MachineModuleInfo *MMI = new MachineModuleInfo(Target.get()); // Construct a custom pass pipeline that starts after instruction // selection. @@ -521,7 +520,7 @@ static int compileModule(char **argv, LLVMContext &Context) { errs() << argv0 << ": run-pass is for .mir file only.\n"; return 1; } - TargetPassConfig &TPC = *LLVMTM.createPassConfig(PM); + TargetPassConfig &TPC = *Target->createPassConfig(PM); if (TPC.hasLimitedCodeGenPipeline()) { errs() << argv0 << ": run-pass cannot be used with " << TPC.getLimitedCodeGenPipelineReason(" and ") << ".\n"; -- cgit v1.2.3