54 assert(TmpAsmInfo &&
"MCAsmInfo not initialized. "
55 "Make sure you include the correct TargetSelect.h"
56 "and that InitializeAllTargetMCs() is being invoked!");
128 std::unique_ptr<MCStreamer> AsmStreamer;
143 auto FOut = llvm::make_unique<formatted_raw_ostream>(Out);
148 AsmStreamer.
reset(S);
165 AsmStreamer.reset(
getTarget().createMCObjectStreamer(
195 StopBefore, StopAfter);
199 if (StopBefore || StopAfter) {
217 bool DisableVerify) {
240 std::unique_ptr<MCStreamer> AsmStreamer(
getTarget().createMCObjectStreamer(
unsigned getAssemblerDialect() const
StringRef getTargetCPU() const
MCTargetOptions MCOptions
Machine level options.
void setCompressDebugSections(DebugCompressionType CompressDebugSections)
virtual void setUseIntegratedAssembler(bool Value)
Set whether assembly (inline or otherwise) should be parsed.
void setDisableVerify(bool Disable)
MCRegisterInfo * createMCRegInfo(StringRef TT) const
createMCRegInfo - Create a MCRegisterInfo implementation.
virtual void reset()
State management.
MCStreamer * createNullStreamer(MCContext &Ctx)
Create a dummy machine code streamer, which does nothing.
bool addISelPasses()
High level function that adds all passes necessary to go from llvm IR representation to the MI repres...
Analysis pass providing the TargetTransformInfo.
print alias Alias Set Printer
CodeGenOpt::Level OptLevel
virtual TargetPassConfig * createPassConfig(PassManagerBase &PM)
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
const MCRegisterInfo * getMCRegisterInfo() const
const Triple & getTargetTriple() const
MCInstrInfo * createMCInstrInfo() const
createMCInstrInfo - Create a MCInstrInfo implementation.
MCSubtargetInfo * createMCSubtargetInfo(StringRef TheTriple, StringRef CPU, StringRef Features) const
createMCSubtargetInfo - Create a MCSubtargetInfo implementation.
unsigned DisableIntegratedAS
Disable the integrated assembler.
MCAsmBackend * createMCAsmBackend(const MCRegisterInfo &MRI, StringRef TheTriple, StringRef CPU, const MCTargetOptions &Options) const
createMCAsmBackend - Create a target specific assembly parser.
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
void setUseNamesOnTempLabels(bool Value)
ExceptionHandling ExceptionModel
What exception model to use.
AsmPrinter * createAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > &&Streamer) const
createAsmPrinter - Create a target specific assembly printer pass.
Target-Independent Code Generator Pass Configuration Options.
const MCAsmInfo * AsmInfo
Contains target specific asm information.
Context object for machine code objects.
const MCInstrInfo * getMCInstrInfo() const
virtual void addMachinePasses()
Add the complete, standard set of LLVM CodeGen passes.
void setStartStopPasses(AnalysisID StartBefore, AnalysisID StartAfter, AnalysisID StopBefore, AnalysisID StopAfter)
Set the StartAfter, StartBefore and StopAfter passes to allow running only a portion of the normal co...
const MCSubtargetInfo * STI
bool addPassesToEmitMC(PassManagerBase &PM, MCContext *&Ctx, raw_pwrite_stream &OS, bool DisableVerify=true) override
Add passes to the specified pass manager to get machine code emitted with the MCJIT.
bool PreserveAsmComments
Preserve Comments in Assembly.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
This class is intended to be used as a base class for asm properties and features specific to the tar...
MCAsmInfo * createMCAsmInfo(const MCRegisterInfo &MRI, StringRef TheTriple) const
createMCAsmInfo - Create a MCAsmInfo implementation for the specified target triple.
Streaming machine code generation interface.
virtual void setPreserveAsmComments(bool Value)
Set whether assembly (inline or otherwise) should be parsed.
void setAllowTemporaryLabels(bool Value)
Concrete BasicTTIImpl that can be used if no further customization is needed.
bool MCIncrementalLinkerCompatible
MCCodeEmitter - Generic instruction encoding interface.
Interface to description of machine instruction set.
FunctionPass * createFreeMachineFunctionPass()
This pass frees the memory occupied by the MachineFunction.
static MCContext * addPassesToGenerateCode(LLVMTargetMachine *TM, PassManagerBase &PM, bool DisableVerify, AnalysisID StartBefore, AnalysisID StartAfter, AnalysisID StopBefore, AnalysisID StopAfter)
addPassesToX helper drives creation and initialization of TargetPassConfig.
MCCodeEmitter * createMCCodeEmitter(const MCInstrInfo &II, const MCRegisterInfo &MRI, MCContext &Ctx) const
createMCCodeEmitter - Create a target specific code emitter.
This class describes a target machine that is implemented with the LLVM target-independent code gener...
FunctionPass class - This class is used to implement most global optimizations.
This file provides a helper that implements much of the TTI interface in terms of the target-independ...
void setRelaxELFRelocations(bool V)
const Target & TheTarget
The Target that this machine was created for.
cl::opt< TargetMachine::CodeGenFileType > FileType("filetype", cl::init(TargetMachine::CGFT_AssemblyFile), cl::desc("Choose a file type (not all types are supported by all targets):"), cl::values(clEnumValN(TargetMachine::CGFT_AssemblyFile,"asm","Emit an assembly ('.s') file"), clEnumValN(TargetMachine::CGFT_ObjectFile,"obj","Emit a native object ('.o') file"), clEnumValN(TargetMachine::CGFT_Null,"null","Emit nothing, for performance testing")))
void adjustCodeGenOpts(const Triple &TT, Reloc::Model RM, CodeModel::Model &CM) const
MCInstPrinter * createMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI) const
Triple - Helper class for working with autoconf configuration names.
StringRef getTargetFeatureString() const
const MCContext & getContext() const
DebugCompressionType CompressDebugSections
Compress DWARF debug sections.
bool addPassesToEmitFile(PassManagerBase &PM, raw_pwrite_stream &Out, CodeGenFileType FileType, bool DisableVerify=true, AnalysisID StartBefore=nullptr, AnalysisID StartAfter=nullptr, AnalysisID StopBefore=nullptr, AnalysisID StopAfter=nullptr) override
Add passes to the specified pass manager to get the specified file emitted.
Target - Wrapper for Target specific information.
unsigned RelaxELFRelocations
const MCRegisterInfo * MRI
MCStreamer * createAsmStreamer(MCContext &Ctx, std::unique_ptr< formatted_raw_ostream > OS, bool IsVerboseAsm, bool UseDwarfDirectory, MCInstPrinter *InstPrint, MCCodeEmitter *CE, MCAsmBackend *TAB, bool ShowInst) const
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
bool addAsmPrinter(PassManagerBase &PM, raw_pwrite_stream &Out, CodeGenFileType FileTYpe, MCContext &Context)
Adds an AsmPrinter pass to the pipeline that prints assembly or machine code from the MI representati...
MCSubtargetInfo - Generic base class for all target subtargets.
const MCSubtargetInfo * getMCSubtargetInfo() const
This file defines passes to print out IR in various granularities.
An abstract base class for streams implementations that also support a pwrite operation.
LLVMTargetMachine(const Target &T, StringRef DataLayoutString, const Triple &TargetTriple, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Generic interface to target specific assembler backends.
const Target & getTarget() const
Primary interface to the complete machine description for the target machine.
void setExceptionsType(ExceptionHandling EH)
StringRef - Represent a constant reference to a string, i.e.
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit...
TargetIRAnalysis getTargetIRAnalysis() override
Get a TargetIRAnalysis implementation for the target.
MachineFunctionPass * createPrintMIRPass(raw_ostream &OS)
MIRPrinting pass - this pass prints out the LLVM IR into the given stream using the MIR serialization...
This class contains meta information specific to a module.