1- // ===-- CodeGenCommonTMImpl .cpp - CodeGenCommonTMImpl implementation ------===//
1+ // ===-- CodeGenTargetMachineImpl .cpp -------------------------------- ------===//
22//
33// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44// See https://llvm.org/LICENSE.txt for license information.
55// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66//
77// ===----------------------------------------------------------------------===//
88// /
9- // / \file This file implements the CodeGenCommonTMImpl class.
9+ // / \file This file implements the CodeGenTargetMachineImpl class.
1010// /
1111// ===----------------------------------------------------------------------===//
1212
13- #include " llvm/CodeGen/CodeGenCommonTMImpl .h"
13+ #include " llvm/CodeGen/CodeGenTargetMachineImpl .h"
1414#include " llvm/CodeGen/AsmPrinter.h"
1515#include " llvm/CodeGen/BasicTTIImpl.h"
1616#include " llvm/CodeGen/MachineModuleInfo.h"
@@ -42,7 +42,7 @@ static cl::opt<bool> EnableNoTrapAfterNoreturn(
4242 cl::desc (" Do not emit a trap instruction for 'unreachable' IR instructions "
4343 " after noreturn calls, even if --trap-unreachable is set." ));
4444
45- void CodeGenCommonTMImpl ::initAsmInfo () {
45+ void CodeGenTargetMachineImpl ::initAsmInfo () {
4646 MRI.reset (TheTarget.createMCRegInfo (getTargetTriple ().str ()));
4747 assert (MRI && " Unable to create reg info" );
4848 MII.reset (TheTarget.createMCInstrInfo ());
@@ -85,7 +85,7 @@ void CodeGenCommonTMImpl::initAsmInfo() {
8585 AsmInfo.reset (TmpAsmInfo);
8686}
8787
88- CodeGenCommonTMImpl::CodeGenCommonTMImpl (
88+ CodeGenTargetMachineImpl::CodeGenTargetMachineImpl (
8989 const Target &T, StringRef DataLayoutString, const Triple &TT,
9090 StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM,
9191 CodeModel::Model CM, CodeGenOptLevel OL)
@@ -101,13 +101,13 @@ CodeGenCommonTMImpl::CodeGenCommonTMImpl(
101101}
102102
103103TargetTransformInfo
104- CodeGenCommonTMImpl ::getTargetTransformInfo (const Function &F) const {
104+ CodeGenTargetMachineImpl ::getTargetTransformInfo (const Function &F) const {
105105 return TargetTransformInfo (BasicTTIImpl (this , F));
106106}
107107
108108// / addPassesToX helper drives creation and initialization of TargetPassConfig.
109109static TargetPassConfig *
110- addPassesToGenerateCode (CodeGenCommonTMImpl &TM, PassManagerBase &PM,
110+ addPassesToGenerateCode (CodeGenTargetMachineImpl &TM, PassManagerBase &PM,
111111 bool DisableVerify,
112112 MachineModuleInfoWrapperPass &MMIWP) {
113113 // Targets may override createPassConfig to provide a target-specific
@@ -125,11 +125,11 @@ addPassesToGenerateCode(CodeGenCommonTMImpl &TM, PassManagerBase &PM,
125125 return PassConfig;
126126}
127127
128- bool CodeGenCommonTMImpl ::addAsmPrinter (PassManagerBase &PM,
129- raw_pwrite_stream &Out,
130- raw_pwrite_stream *DwoOut,
131- CodeGenFileType FileType,
132- MCContext &Context) {
128+ bool CodeGenTargetMachineImpl ::addAsmPrinter (PassManagerBase &PM,
129+ raw_pwrite_stream &Out,
130+ raw_pwrite_stream *DwoOut,
131+ CodeGenFileType FileType,
132+ MCContext &Context) {
133133 Expected<std::unique_ptr<MCStreamer>> MCStreamerOrErr =
134134 createMCStreamer (Out, DwoOut, FileType, Context);
135135 if (auto Err = MCStreamerOrErr.takeError ())
@@ -145,9 +145,11 @@ bool CodeGenCommonTMImpl::addAsmPrinter(PassManagerBase &PM,
145145 return false ;
146146}
147147
148- Expected<std::unique_ptr<MCStreamer>> CodeGenCommonTMImpl::createMCStreamer (
149- raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType,
150- MCContext &Context) {
148+ Expected<std::unique_ptr<MCStreamer>>
149+ CodeGenTargetMachineImpl::createMCStreamer (raw_pwrite_stream &Out,
150+ raw_pwrite_stream *DwoOut,
151+ CodeGenFileType FileType,
152+ MCContext &Context) {
151153 const MCSubtargetInfo &STI = *getMCSubtargetInfo ();
152154 const MCAsmInfo &MAI = *getMCAsmInfo ();
153155 const MCRegisterInfo &MRI = *getMCRegisterInfo ();
@@ -206,7 +208,7 @@ Expected<std::unique_ptr<MCStreamer>> CodeGenCommonTMImpl::createMCStreamer(
206208 return std::move (AsmStreamer);
207209}
208210
209- bool CodeGenCommonTMImpl ::addPassesToEmitFile (
211+ bool CodeGenTargetMachineImpl ::addPassesToEmitFile (
210212 PassManagerBase &PM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut,
211213 CodeGenFileType FileType, bool DisableVerify,
212214 MachineModuleInfoWrapperPass *MMIWP) {
@@ -236,10 +238,10 @@ bool CodeGenCommonTMImpl::addPassesToEmitFile(
236238// / code is not supported. It fills the MCContext Ctx pointer which can be
237239// / used to build custom MCStreamer.
238240// /
239- bool CodeGenCommonTMImpl ::addPassesToEmitMC (PassManagerBase &PM,
240- MCContext *&Ctx,
241- raw_pwrite_stream &Out,
242- bool DisableVerify) {
241+ bool CodeGenTargetMachineImpl ::addPassesToEmitMC (PassManagerBase &PM,
242+ MCContext *&Ctx,
243+ raw_pwrite_stream &Out,
244+ bool DisableVerify) {
243245 // Add common CodeGen passes.
244246 MachineModuleInfoWrapperPass *MMIWP = new MachineModuleInfoWrapperPass (this );
245247 TargetPassConfig *PassConfig =
0 commit comments