1
- // ===-- CodeGenCommonTMImpl .cpp - CodeGenCommonTMImpl implementation ------===//
1
+ // ===-- CodeGenTargetMachineImpl .cpp -------------------------------- ------===//
2
2
//
3
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
4
// See https://llvm.org/LICENSE.txt for license information.
5
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
6
//
7
7
// ===----------------------------------------------------------------------===//
8
8
// /
9
- // / \file This file implements the CodeGenCommonTMImpl class.
9
+ // / \file This file implements the CodeGenTargetMachineImpl class.
10
10
// /
11
11
// ===----------------------------------------------------------------------===//
12
12
13
- #include " llvm/CodeGen/CodeGenCommonTMImpl .h"
13
+ #include " llvm/CodeGen/CodeGenTargetMachineImpl .h"
14
14
#include " llvm/CodeGen/AsmPrinter.h"
15
15
#include " llvm/CodeGen/BasicTTIImpl.h"
16
16
#include " llvm/CodeGen/MachineModuleInfo.h"
@@ -42,7 +42,7 @@ static cl::opt<bool> EnableNoTrapAfterNoreturn(
42
42
cl::desc (" Do not emit a trap instruction for 'unreachable' IR instructions "
43
43
" after noreturn calls, even if --trap-unreachable is set." ));
44
44
45
- void CodeGenCommonTMImpl ::initAsmInfo () {
45
+ void CodeGenTargetMachineImpl ::initAsmInfo () {
46
46
MRI.reset (TheTarget.createMCRegInfo (getTargetTriple ().str ()));
47
47
assert (MRI && " Unable to create reg info" );
48
48
MII.reset (TheTarget.createMCInstrInfo ());
@@ -85,7 +85,7 @@ void CodeGenCommonTMImpl::initAsmInfo() {
85
85
AsmInfo.reset (TmpAsmInfo);
86
86
}
87
87
88
- CodeGenCommonTMImpl::CodeGenCommonTMImpl (
88
+ CodeGenTargetMachineImpl::CodeGenTargetMachineImpl (
89
89
const Target &T, StringRef DataLayoutString, const Triple &TT,
90
90
StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM,
91
91
CodeModel::Model CM, CodeGenOptLevel OL)
@@ -101,13 +101,13 @@ CodeGenCommonTMImpl::CodeGenCommonTMImpl(
101
101
}
102
102
103
103
TargetTransformInfo
104
- CodeGenCommonTMImpl ::getTargetTransformInfo (const Function &F) const {
104
+ CodeGenTargetMachineImpl ::getTargetTransformInfo (const Function &F) const {
105
105
return TargetTransformInfo (BasicTTIImpl (this , F));
106
106
}
107
107
108
108
// / addPassesToX helper drives creation and initialization of TargetPassConfig.
109
109
static TargetPassConfig *
110
- addPassesToGenerateCode (CodeGenCommonTMImpl &TM, PassManagerBase &PM,
110
+ addPassesToGenerateCode (CodeGenTargetMachineImpl &TM, PassManagerBase &PM,
111
111
bool DisableVerify,
112
112
MachineModuleInfoWrapperPass &MMIWP) {
113
113
// Targets may override createPassConfig to provide a target-specific
@@ -125,11 +125,11 @@ addPassesToGenerateCode(CodeGenCommonTMImpl &TM, PassManagerBase &PM,
125
125
return PassConfig;
126
126
}
127
127
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) {
133
133
Expected<std::unique_ptr<MCStreamer>> MCStreamerOrErr =
134
134
createMCStreamer (Out, DwoOut, FileType, Context);
135
135
if (auto Err = MCStreamerOrErr.takeError ())
@@ -145,9 +145,11 @@ bool CodeGenCommonTMImpl::addAsmPrinter(PassManagerBase &PM,
145
145
return false ;
146
146
}
147
147
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) {
151
153
const MCSubtargetInfo &STI = *getMCSubtargetInfo ();
152
154
const MCAsmInfo &MAI = *getMCAsmInfo ();
153
155
const MCRegisterInfo &MRI = *getMCRegisterInfo ();
@@ -206,7 +208,7 @@ Expected<std::unique_ptr<MCStreamer>> CodeGenCommonTMImpl::createMCStreamer(
206
208
return std::move (AsmStreamer);
207
209
}
208
210
209
- bool CodeGenCommonTMImpl ::addPassesToEmitFile (
211
+ bool CodeGenTargetMachineImpl ::addPassesToEmitFile (
210
212
PassManagerBase &PM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut,
211
213
CodeGenFileType FileType, bool DisableVerify,
212
214
MachineModuleInfoWrapperPass *MMIWP) {
@@ -236,10 +238,10 @@ bool CodeGenCommonTMImpl::addPassesToEmitFile(
236
238
// / code is not supported. It fills the MCContext Ctx pointer which can be
237
239
// / used to build custom MCStreamer.
238
240
// /
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) {
243
245
// Add common CodeGen passes.
244
246
MachineModuleInfoWrapperPass *MMIWP = new MachineModuleInfoWrapperPass (this );
245
247
TargetPassConfig *PassConfig =
0 commit comments