LLVM  14.0.0git
LLVMTargetMachine.cpp
Go to the documentation of this file.
1 //===-- LLVMTargetMachine.cpp - Implement the LLVMTargetMachine class -----===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the LLVMTargetMachine class.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "llvm/Analysis/Passes.h"
17 #include "llvm/CodeGen/Passes.h"
20 #include "llvm/MC/MCAsmBackend.h"
21 #include "llvm/MC/MCAsmInfo.h"
22 #include "llvm/MC/MCCodeEmitter.h"
23 #include "llvm/MC/MCContext.h"
24 #include "llvm/MC/MCInstrInfo.h"
25 #include "llvm/MC/MCObjectWriter.h"
26 #include "llvm/MC/MCStreamer.h"
28 #include "llvm/MC/TargetRegistry.h"
35 using namespace llvm;
36 
37 static cl::opt<bool> EnableTrapUnreachable("trap-unreachable",
39  cl::desc("Enable generating trap for unreachable"));
40 
43  assert(MRI && "Unable to create reg info");
45  assert(MII && "Unable to create instruction info");
46  // FIXME: Having an MCSubtargetInfo on the target machine is a hack due
47  // to some backends having subtarget feature dependent module level
48  // code generation. This is similar to the hack in the AsmPrinter for
49  // module level assembly etc.
52  assert(STI && "Unable to create subtarget info");
53 
54  MCAsmInfo *TmpAsmInfo = TheTarget.createMCAsmInfo(
56  // TargetSelect.h moved to a different directory between LLVM 2.9 and 3.0,
57  // and if the old one gets included then MCAsmInfo will be NULL and
58  // we'll crash later.
59  // Provide the user with a useful error message about what's wrong.
60  assert(TmpAsmInfo && "MCAsmInfo not initialized. "
61  "Make sure you include the correct TargetSelect.h"
62  "and that InitializeAllTargetMCs() is being invoked!");
63 
64  if (Options.BinutilsVersion.first > 0)
66 
68  TmpAsmInfo->setUseIntegratedAssembler(false);
69  // If there is explict option disable integratedAS, we can't use it for
70  // inlineasm either.
71  TmpAsmInfo->setParseInlineAsmUsingAsmParser(false);
72  }
73 
75 
77 
79 
82 
83  AsmInfo.reset(TmpAsmInfo);
84 }
85 
87  StringRef DataLayoutString,
88  const Triple &TT, StringRef CPU,
92  : TargetMachine(T, DataLayoutString, TT, CPU, FS, Options) {
93  this->RM = RM;
94  this->CMModel = CM;
95  this->OptLevel = OL;
96 
98  this->Options.TrapUnreachable = true;
99 }
100 
103  return TargetTransformInfo(BasicTTIImpl(this, F));
104 }
105 
106 /// addPassesToX helper drives creation and initialization of TargetPassConfig.
107 static TargetPassConfig *
109  bool DisableVerify,
111  // Targets may override createPassConfig to provide a target-specific
112  // subclass.
113  TargetPassConfig *PassConfig = TM.createPassConfig(PM);
114  // Set PassConfig options provided by TargetMachine.
115  PassConfig->setDisableVerify(DisableVerify);
116  PM.add(PassConfig);
117  PM.add(&MMIWP);
118 
119  if (PassConfig->addISelPasses())
120  return nullptr;
121  PassConfig->addMachinePasses();
122  PassConfig->setInitialized();
123  return PassConfig;
124 }
125 
127  raw_pwrite_stream &Out,
128  raw_pwrite_stream *DwoOut,
130  MCContext &Context) {
131  Expected<std::unique_ptr<MCStreamer>> MCStreamerOrErr =
132  createMCStreamer(Out, DwoOut, FileType, Context);
133  if (auto Err = MCStreamerOrErr.takeError())
134  return true;
135 
136  // Create the AsmPrinter, which takes ownership of AsmStreamer if successful.
138  getTarget().createAsmPrinter(*this, std::move(*MCStreamerOrErr));
139  if (!Printer)
140  return true;
141 
142  PM.add(Printer);
143  return false;
144 }
145 
148  MCContext &Context) {
150  Context.setAllowTemporaryLabels(false);
151 
153  const MCAsmInfo &MAI = *getMCAsmInfo();
155  const MCInstrInfo &MII = *getMCInstrInfo();
156 
157  std::unique_ptr<MCStreamer> AsmStreamer;
158 
159  switch (FileType) {
160  case CGFT_AssemblyFile: {
162  getTargetTriple(), MAI.getAssemblerDialect(), MAI, MII, MRI);
163 
164  // Create a code emitter if asked to show the encoding.
165  std::unique_ptr<MCCodeEmitter> MCE;
167  MCE.reset(getTarget().createMCCodeEmitter(MII, MRI, Context));
168 
169  std::unique_ptr<MCAsmBackend> MAB(
170  getTarget().createMCAsmBackend(STI, MRI, Options.MCOptions));
171  auto FOut = std::make_unique<formatted_raw_ostream>(Out);
174  Options.MCOptions.MCUseDwarfDirectory, InstPrinter, std::move(MCE),
176  AsmStreamer.reset(S);
177  break;
178  }
179  case CGFT_ObjectFile: {
180  // Create the code emitter for the target if it exists. If not, .o file
181  // emission fails.
183  if (!MCE)
184  return make_error<StringError>("createMCCodeEmitter failed",
186  MCAsmBackend *MAB =
188  if (!MAB)
189  return make_error<StringError>("createMCAsmBackend failed",
191 
192  Triple T(getTargetTriple().str());
193  AsmStreamer.reset(getTarget().createMCObjectStreamer(
194  T, Context, std::unique_ptr<MCAsmBackend>(MAB),
195  DwoOut ? MAB->createDwoObjectWriter(Out, *DwoOut)
196  : MAB->createObjectWriter(Out),
197  std::unique_ptr<MCCodeEmitter>(MCE), STI, Options.MCOptions.MCRelaxAll,
199  /*DWARFMustBeAtTheEnd*/ true));
200  break;
201  }
202  case CGFT_Null:
203  // The Null output is intended for use for performance analysis and testing,
204  // not real users.
205  AsmStreamer.reset(getTarget().createNullStreamer(Context));
206  break;
207  }
208 
209  return std::move(AsmStreamer);
210 }
211 
214  CodeGenFileType FileType, bool DisableVerify,
216  // Add common CodeGen passes.
217  if (!MMIWP)
218  MMIWP = new MachineModuleInfoWrapperPass(this);
219  TargetPassConfig *PassConfig =
220  addPassesToGenerateCode(*this, PM, DisableVerify, *MMIWP);
221  if (!PassConfig)
222  return true;
223 
225  if (addAsmPrinter(PM, Out, DwoOut, FileType, MMIWP->getMMI().getContext()))
226  return true;
227  } else {
228  // MIR printing is redundant with -filetype=null.
229  if (FileType != CGFT_Null)
230  PM.add(createPrintMIRPass(Out));
231  }
232 
234  return false;
235 }
236 
237 /// addPassesToEmitMC - Add passes to the specified pass manager to get
238 /// machine code emitted with the MCJIT. This method returns true if machine
239 /// code is not supported. It fills the MCContext Ctx pointer which can be
240 /// used to build custom MCStreamer.
241 ///
243  raw_pwrite_stream &Out,
244  bool DisableVerify) {
245  // Add common CodeGen passes.
247  TargetPassConfig *PassConfig =
248  addPassesToGenerateCode(*this, PM, DisableVerify, *MMIWP);
249  if (!PassConfig)
250  return true;
252  "Cannot emit MC with limited codegen pipeline");
253 
254  Ctx = &MMIWP->getMMI().getContext();
256  Ctx->setAllowTemporaryLabels(false);
257 
258  // Create the code emitter for the target if it exists. If not, .o file
259  // emission fails.
262  MCCodeEmitter *MCE =
264  MCAsmBackend *MAB =
266  if (!MCE || !MAB)
267  return true;
268 
269  const Triple &T = getTargetTriple();
270  std::unique_ptr<MCStreamer> AsmStreamer(getTarget().createMCObjectStreamer(
271  T, *Ctx, std::unique_ptr<MCAsmBackend>(MAB), MAB->createObjectWriter(Out),
272  std::unique_ptr<MCCodeEmitter>(MCE), STI, Options.MCOptions.MCRelaxAll,
274  /*DWARFMustBeAtTheEnd*/ true));
275 
276  // Create the AsmPrinter, which takes ownership of AsmStreamer if successful.
278  getTarget().createAsmPrinter(*this, std::move(AsmStreamer));
279  if (!Printer)
280  return true;
281 
282  PM.add(Printer);
284 
285  return false; // success!
286 }
AsmPrinter.h
llvm::MCAsmInfo::setRelaxELFRelocations
void setRelaxELFRelocations(bool V)
Definition: MCAsmInfo.h:854
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::TargetMachine::STI
std::unique_ptr< const MCSubtargetInfo > STI
Definition: TargetMachine.h:110
llvm::MachineModuleInfo::getContext
const MCContext & getContext() const
Definition: MachineModuleInfo.h:167
llvm::CGFT_ObjectFile
@ CGFT_ObjectFile
Definition: CodeGen.h:65
llvm::TargetOptions
Definition: TargetOptions.h:124
llvm::TargetPassConfig::willCompleteCodeGenPipeline
static bool willCompleteCodeGenPipeline()
Returns true if none of the -stop-before and -stop-after options is set.
Definition: TargetPassConfig.cpp:665
T
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:72
llvm::Function
Definition: Function.h:62
llvm::TargetMachine::TheTarget
const Target & TheTarget
The Target that this machine was created for.
Definition: TargetMachine.h:86
MCCodeEmitter.h
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:137
llvm::MCAsmInfo
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
llvm::Target::createMCAsmInfo
MCAsmInfo * createMCAsmInfo(const MCRegisterInfo &MRI, StringRef TheTriple, const MCTargetOptions &Options) const
createMCAsmInfo - Create a MCAsmInfo implementation for the specified target triple.
Definition: TargetRegistry.h:382
llvm::TargetMachine::getMCRegisterInfo
const MCRegisterInfo * getMCRegisterInfo() const
Definition: TargetMachine.h:209
ErrorHandling.h
llvm::TargetTransformInfo
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
Definition: TargetTransformInfo.h:168
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
llvm::cl::Hidden
@ Hidden
Definition: CommandLine.h:143
llvm::CGFT_Null
@ CGFT_Null
Definition: CodeGen.h:66
llvm::LLVMTargetMachine::getTargetTransformInfo
TargetTransformInfo getTargetTransformInfo(const Function &F) override
Get a TargetTransformInfo implementation for the target.
Definition: LLVMTargetMachine.cpp:102
llvm::Target::createMCCodeEmitter
MCCodeEmitter * createMCCodeEmitter(const MCInstrInfo &II, const MCRegisterInfo &MRI, MCContext &Ctx) const
createMCCodeEmitter - Create a target specific code emitter.
Definition: TargetRegistry.h:510
llvm::TargetOptions::TrapUnreachable
unsigned TrapUnreachable
Emit target-specific trap instruction for 'unreachable' IR instructions.
Definition: TargetOptions.h:274
llvm::TargetMachine::MII
std::unique_ptr< const MCInstrInfo > MII
Definition: TargetMachine.h:109
llvm::MachineModuleInfoWrapperPass::getMMI
MachineModuleInfo & getMMI()
Definition: MachineModuleInfo.h:293
llvm::TargetMachine::RM
Reloc::Model RM
Definition: TargetMachine.h:102
llvm::TargetOptions::CompressDebugSections
DebugCompressionType CompressDebugSections
Compress DWARF debug sections.
Definition: TargetOptions.h:252
llvm::Target::createAsmStreamer
MCStreamer * createAsmStreamer(MCContext &Ctx, std::unique_ptr< formatted_raw_ostream > OS, bool IsVerboseAsm, bool UseDwarfDirectory, MCInstPrinter *InstPrint, std::unique_ptr< MCCodeEmitter > &&CE, std::unique_ptr< MCAsmBackend > &&TAB, bool ShowInst) const
Definition: TargetRegistry.h:585
llvm::MCAsmInfo::getAssemblerDialect
unsigned getAssemblerDialect() const
Definition: MCAsmInfo.h:672
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
llvm::MCAsmBackend::createDwoObjectWriter
std::unique_ptr< MCObjectWriter > createDwoObjectWriter(raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS) const
Create an MCObjectWriter that writes two object files: a .o file which is linked into the final progr...
Definition: MCAsmBackend.cpp:54
LegacyPassManager.h
llvm::Target::createMCInstrInfo
MCInstrInfo * createMCInstrInfo() const
createMCInstrInfo - Create a MCInstrInfo implementation.
Definition: TargetRegistry.h:404
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::Reloc::Model
Model
Definition: CodeGen.h:22
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::Target::createMCRegInfo
MCRegisterInfo * createMCRegInfo(StringRef TT) const
createMCRegInfo - Create a MCRegisterInfo implementation.
Definition: TargetRegistry.h:420
CommandLine.h
FormattedStream.h
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:199
Printer
print alias Alias Set Printer
Definition: AliasSetTracker.cpp:762
llvm::MCAsmInfo::setExceptionsType
void setExceptionsType(ExceptionHandling EH)
Definition: MCAsmInfo.h:765
llvm::MCAsmBackend
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:36
TargetMachine.h
MCAsmBackend.h
llvm::MCTargetOptions::ShowMCEncoding
bool ShowMCEncoding
Definition: MCTargetOptions.h:52
EnableTrapUnreachable
static cl::opt< bool > EnableTrapUnreachable("trap-unreachable", cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::desc("Enable generating trap for unreachable"))
llvm::TargetPassConfig::setDisableVerify
void setDisableVerify(bool Disable)
Definition: TargetPassConfig.h:174
MCContext.h
MCInstrInfo.h
llvm::TargetOptions::MCOptions
MCTargetOptions MCOptions
Machine level options.
Definition: TargetOptions.h:420
llvm::TargetOptions::ExceptionModel
ExceptionHandling ExceptionModel
What exception model to use.
Definition: TargetOptions.h:417
MCSubtargetInfo.h
llvm::MCContext::setAllowTemporaryLabels
void setAllowTemporaryLabels(bool Value)
Definition: MCContext.h:433
llvm::X86AS::FS
@ FS
Definition: X86.h:188
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
llvm::LLVMTargetMachine::addPassesToEmitFile
bool addPassesToEmitFile(PassManagerBase &PM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, bool DisableVerify=true, MachineModuleInfoWrapperPass *MMIWP=nullptr) override
Add passes to the specified pass manager to get the specified file emitted.
Definition: LLVMTargetMachine.cpp:212
llvm::TargetOptions::RelaxELFRelocations
unsigned RelaxELFRelocations
Definition: TargetOptions.h:254
addPassesToGenerateCode
static TargetPassConfig * addPassesToGenerateCode(LLVMTargetMachine &TM, PassManagerBase &PM, bool DisableVerify, MachineModuleInfoWrapperPass &MMIWP)
addPassesToX helper drives creation and initialization of TargetPassConfig.
Definition: LLVMTargetMachine.cpp:108
llvm::TargetMachine::getMCInstrInfo
const MCInstrInfo * getMCInstrInfo() const
Definition: TargetMachine.h:210
llvm::MCAsmInfo::setUseIntegratedAssembler
virtual void setUseIntegratedAssembler(bool Value)
Set whether assembly (inline or otherwise) should be parsed.
Definition: MCAsmInfo.h:826
llvm::legacy::PassManagerBase::add
virtual void add(Pass *P)=0
Add a pass to the queue of passes to run.
llvm::MachO::FileType
FileType
Defines the file type this file represents.
Definition: InterfaceFile.h:57
llvm::CodeModel::Model
Model
Definition: CodeGen.h:28
llvm::cl::ZeroOrMore
@ ZeroOrMore
Definition: CommandLine.h:120
Passes.h
llvm::TargetPassConfig
Target-Independent Code Generator Pass Configuration Options.
Definition: TargetPassConfig.h:84
llvm::LLVMTargetMachine::addPassesToEmitMC
bool addPassesToEmitMC(PassManagerBase &PM, MCContext *&Ctx, raw_pwrite_stream &Out, bool DisableVerify=true) override
Add passes to the specified pass manager to get machine code emitted with the MCJIT.
Definition: LLVMTargetMachine.cpp:242
llvm::cl::opt< bool >
llvm::TargetPassConfig::addMachinePasses
virtual void addMachinePasses()
Add the complete, standard set of LLVM CodeGen passes.
Definition: TargetPassConfig.cpp:1127
llvm::LLVMTargetMachine::LLVMTargetMachine
LLVMTargetMachine(const Target &T, StringRef DataLayoutString, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
Definition: LLVMTargetMachine.cpp:86
llvm::MCTargetOptions::MCIncrementalLinkerCompatible
bool MCIncrementalLinkerCompatible
Definition: MCTargetOptions.h:51
llvm::raw_pwrite_stream
An abstract base class for streams implementations that also support a pwrite operation.
Definition: raw_ostream.h:417
llvm::MCInstPrinter
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:43
llvm::MachineModuleInfoWrapperPass
Definition: MachineModuleInfo.h:279
llvm::MCTargetOptions::MCUseDwarfDirectory
bool MCUseDwarfDirectory
Definition: MCTargetOptions.h:50
llvm::createPrintMIRPass
MachineFunctionPass * createPrintMIRPass(raw_ostream &OS)
MIRPrinting pass - this pass prints out the LLVM IR into the given stream using the MIR serialization...
Definition: MIRPrintingPass.cpp:66
llvm::TargetMachine::getMCSubtargetInfo
const MCSubtargetInfo * getMCSubtargetInfo() const
Definition: TargetMachine.h:211
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::TargetMachine::OptLevel
CodeGenOpt::Level OptLevel
Definition: TargetMachine.h:104
llvm::cl::init
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:441
llvm::createNullStreamer
MCStreamer * createNullStreamer(MCContext &Ctx)
Create a dummy machine code streamer, which does nothing.
Definition: MCNullStreamer.cpp:47
TargetPassConfig.h
llvm::TargetMachine::Options
TargetOptions Options
Definition: TargetMachine.h:120
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:79
llvm::Target::createAsmPrinter
AsmPrinter * createAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > &&Streamer) const
createAsmPrinter - Create a target specific assembly printer pass.
Definition: TargetRegistry.h:486
llvm::TargetPassConfig::setInitialized
void setInitialized()
Definition: TargetPassConfig.h:156
MachineModuleInfo.h
llvm::TargetPassConfig::addISelPasses
bool addISelPasses()
High level function that adds all passes necessary to go from llvm IR representation to the MI repres...
Definition: TargetPassConfig.cpp:1088
llvm::MCAsmInfo::setParseInlineAsmUsingAsmParser
virtual void setParseInlineAsmUsingAsmParser(bool Value)
Set whether target want to use AsmParser to parse inlineasm.
Definition: MCAsmInfo.h:831
llvm::createFreeMachineFunctionPass
FunctionPass * createFreeMachineFunctionPass()
This pass frees the memory occupied by the MachineFunction.
Definition: MachineModuleInfo.cpp:351
TargetOptions.h
llvm::AArch64::RM
@ RM
Definition: AArch64ISelLowering.h:476
llvm::TargetMachine::getMCAsmInfo
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
Definition: TargetMachine.h:207
llvm::Target::createMCAsmBackend
MCAsmBackend * createMCAsmBackend(const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options) const
createMCAsmBackend - Create a target specific assembly parser.
Definition: TargetRegistry.h:463
MCAsmInfo.h
llvm::CodeGenFileType
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit,...
Definition: CodeGen.h:63
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
TargetLoweringObjectFile.h
llvm::TargetOptions::BinutilsVersion
std::pair< int, int > BinutilsVersion
If greater than 0, override the default value of MCAsmInfo::BinutilsVersion.
Definition: TargetOptions.h:154
llvm::TargetMachine::getTargetFeatureString
StringRef getTargetFeatureString() const
Definition: TargetMachine.h:130
llvm::MCTargetOptions::ShowMCInst
bool ShowMCInst
Definition: MCTargetOptions.h:53
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::CodeGenOpt::Level
Level
Definition: CodeGen.h:52
llvm::MCRegisterInfo
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Definition: MCRegisterInfo.h:135
llvm::LLVMTargetMachine::initAsmInfo
void initAsmInfo()
Definition: LLVMTargetMachine.cpp:41
llvm::MCAsmInfo::setBinutilsVersion
void setBinutilsVersion(std::pair< int, int > Value)
Definition: MCAsmInfo.h:809
MCObjectWriter.h
llvm::Target::createMCSubtargetInfo
MCSubtargetInfo * createMCSubtargetInfo(StringRef TheTriple, StringRef CPU, StringRef Features) const
createMCSubtargetInfo - Create a MCSubtargetInfo implementation.
Definition: TargetRegistry.h:435
llvm::MCInstrInfo
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:25
llvm::Target::createMCInstPrinter
MCInstPrinter * createMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI) const
Definition: TargetRegistry.h:500
llvm::BasicTTIImpl
Concrete BasicTTIImpl that can be used if no further customization is needed.
Definition: BasicTTIImpl.h:2205
llvm::inconvertibleErrorCode
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
Definition: Error.cpp:77
llvm::MCCodeEmitter
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:21
llvm::MCTargetOptions::MCRelaxAll
bool MCRelaxAll
Definition: MCTargetOptions.h:43
llvm::MCTargetOptions::AsmVerbose
bool AsmVerbose
Definition: MCTargetOptions.h:54
llvm::LLVMTargetMachine
This class describes a target machine that is implemented with the LLVM target-independent code gener...
Definition: TargetMachine.h:393
llvm::MCAsmInfo::setCompressDebugSections
void setCompressDebugSections(DebugCompressionType CompressDebugSections)
Definition: MCAsmInfo.h:847
llvm::ExceptionHandling::None
@ None
No exception support.
llvm::Expected::takeError
Error takeError()
Take ownership of the stored error.
Definition: Error.h:589
llvm::TargetMachine::CMModel
CodeModel::Model CMModel
Definition: TargetMachine.h:103
llvm::TargetMachine::getTargetCPU
StringRef getTargetCPU() const
Definition: TargetMachine.h:129
llvm::MCAsmBackend::createObjectWriter
std::unique_ptr< MCObjectWriter > createObjectWriter(raw_pwrite_stream &OS) const
Create a new MCObjectWriter instance for use by the assembler backend to emit the final object file.
Definition: MCAsmBackend.cpp:30
llvm::MCTargetOptions::MCSaveTempLabels
bool MCSaveTempLabels
Definition: MCTargetOptions.h:49
MCStreamer.h
llvm::TargetMachine::AsmInfo
std::unique_ptr< const MCAsmInfo > AsmInfo
Contains target specific asm information.
Definition: TargetMachine.h:107
llvm::TargetMachine::getTargetTriple
const Triple & getTargetTriple() const
Definition: TargetMachine.h:128
llvm::MCAsmInfo::setPreserveAsmComments
virtual void setPreserveAsmComments(bool Value)
Set whether assembly (inline or otherwise) should be parsed.
Definition: MCAsmInfo.h:839
llvm::legacy::PassManagerBase
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
Definition: LegacyPassManager.h:39
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
llvm::MCTargetOptions::PreserveAsmComments
bool PreserveAsmComments
Preserve Comments in Assembly.
Definition: MCTargetOptions.h:57
llvm::FunctionPass
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:298
llvm::TargetOptions::DisableIntegratedAS
unsigned DisableIntegratedAS
Disable the integrated assembler.
Definition: TargetOptions.h:249
BasicTTIImpl.h
llvm::cl::desc
Definition: CommandLine.h:412
llvm::TargetMachine::getTarget
const Target & getTarget() const
Definition: TargetMachine.h:126
llvm::CGFT_AssemblyFile
@ CGFT_AssemblyFile
Definition: CodeGen.h:64
TargetRegistry.h
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:75
llvm::TargetMachine::MRI
std::unique_ptr< const MCRegisterInfo > MRI
Definition: TargetMachine.h:108
llvm::LLVMTargetMachine::createMCStreamer
Expected< std::unique_ptr< MCStreamer > > createMCStreamer(raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, MCContext &Ctx)
Definition: LLVMTargetMachine.cpp:146
llvm::MCStreamer::reset
virtual void reset()
State management.
Definition: MCStreamer.cpp:101
llvm::LLVMTargetMachine::addAsmPrinter
bool addAsmPrinter(PassManagerBase &PM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, MCContext &Context)
Adds an AsmPrinter pass to the pipeline that prints assembly or machine code from the MI representati...
Definition: LLVMTargetMachine.cpp:126
Passes.h