39 cl::desc(
"Enable generating trap for unreachable"));
57 assert(TmpAsmInfo &&
"MCAsmInfo not initialized. " 58 "Make sure you include the correct TargetSelect.h" 59 "and that InitializeAllTargetMCs() is being invoked!");
129 std::unique_ptr<MCStreamer> AsmStreamer;
137 std::unique_ptr<MCCodeEmitter> MCE;
139 MCE.reset(
getTarget().createMCCodeEmitter(MII, MRI, Context));
141 std::unique_ptr<MCAsmBackend> MAB(
143 auto FOut = std::make_unique<formatted_raw_ostream>(Out);
148 AsmStreamer.
reset(S);
164 AsmStreamer.reset(
getTarget().createMCObjectStreamer(
165 T, Context, std::unique_ptr<MCAsmBackend>(MAB),
210 .Initialize(Ctx, *
this);
228 bool DisableVerify) {
236 "Cannot emit MC with limited codegen pipeline");
254 std::unique_ptr<MCStreamer> AsmStreamer(
getTarget().createMCObjectStreamer(
const MCRegisterInfo * getMCRegisterInfo() const
MCAsmInfo * createMCAsmInfo(const MCRegisterInfo &MRI, StringRef TheTriple, const MCTargetOptions &Options) const
createMCAsmInfo - Create a MCAsmInfo implementation for the specified target triple.
StringRef getTargetFeatureString() const
MCTargetOptions MCOptions
Machine level options.
This class represents lattice values for constants.
void setCompressDebugSections(DebugCompressionType CompressDebugSections)
virtual void setUseIntegratedAssembler(bool Value)
Set whether assembly (inline or otherwise) should be parsed.
void setDisableVerify(bool Disable)
MCAsmBackend * createMCAsmBackend(const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options) const
createMCAsmBackend - Create a target specific assembly parser.
MCInstrInfo * createMCInstrInfo() const
createMCInstrInfo - Create a MCInstrInfo 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...
virtual void add(Pass *P)=0
Add a pass to the queue of passes to run.
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.
print alias Alias Set Printer
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...
CodeGenOpt::Level OptLevel
virtual TargetPassConfig * createPassConfig(PassManagerBase &PM)
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
unsigned DisableIntegratedAS
Disable the integrated assembler.
MCInstPrinter * createMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI) const
TargetTransformInfo getTargetTransformInfo(const Function &F) override
Get a TargetTransformInfo implementation for the target.
void setUseNamesOnTempLabels(bool Value)
ExceptionHandling ExceptionModel
What exception model to use.
Target-Independent Code Generator Pass Configuration Options.
Context object for machine code objects.
virtual void addMachinePasses()
Add the complete, standard set of LLVM CodeGen passes.
const MCContext & getContext() const
MachineModuleInfo & getMMI()
static cl::opt< bool > EnableTrapUnreachable("trap-unreachable", cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::desc("Enable generating trap for unreachable"))
std::unique_ptr< const MCSubtargetInfo > STI
StringRef getTargetCPU() const
bool PreserveAsmComments
Preserve Comments in Assembly.
MCCodeEmitter * createMCCodeEmitter(const MCInstrInfo &II, const MCRegisterInfo &MRI, MCContext &Ctx) const
createMCCodeEmitter - Create a target specific code emitter.
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...
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit...
initializer< Ty > init(const Ty &Val)
Streaming machine code generation interface.
virtual void setPreserveAsmComments(bool Value)
Set whether assembly (inline or otherwise) should be parsed.
AsmPrinter * createAsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > &&Streamer) const
createAsmPrinter - Create a target specific assembly printer pass.
void setAllowTemporaryLabels(bool Value)
Concrete BasicTTIImpl that can be used if no further customization is needed.
bool MCIncrementalLinkerCompatible
unsigned getAssemblerDialect() const
MCCodeEmitter - Generic instruction encoding interface.
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
static TargetPassConfig * addPassesToGenerateCode(LLVMTargetMachine &TM, PassManagerBase &PM, bool DisableVerify, MachineModuleInfoWrapperPass &MMIWP)
addPassesToX helper drives creation and initialization of TargetPassConfig.
Interface to description of machine instruction set.
FunctionPass * createFreeMachineFunctionPass()
This pass frees the memory occupied by the MachineFunction.
std::unique_ptr< const MCAsmInfo > AsmInfo
Contains target specific asm information.
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.
MCRegisterInfo * createMCRegInfo(StringRef TT) const
createMCRegInfo - Create a MCRegisterInfo implementation.
const Triple & getTargetTriple() const
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.
const Target & getTarget() const
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)
Triple - Helper class for working with autoconf configuration names.
FileType
Defines the file type this file represents.
virtual TargetLoweringObjectFile * getObjFileLowering() const
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
DebugCompressionType CompressDebugSections
Compress DWARF debug sections.
const MCSubtargetInfo * getMCSubtargetInfo() const
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...
Target - Wrapper for Target specific information.
unsigned RelaxELFRelocations
MCSubtargetInfo * createMCSubtargetInfo(StringRef TheTriple, StringRef CPU, StringRef Features) const
createMCSubtargetInfo - Create a MCSubtargetInfo implementation.
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Generic base class for all target subtargets.
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
std::unique_ptr< const MCInstrInfo > MII
static bool willCompleteCodeGenPipeline()
Returns true if none of the -stop-before and -stop-after options is set.
std::unique_ptr< const MCRegisterInfo > MRI
An abstract base class for streams implementations that also support a pwrite operation.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const MCInstrInfo * getMCInstrInfo() const
Generic interface to target specific assembler backends.
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.
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.
unsigned TrapUnreachable
Emit target-specific trap instruction for 'unreachable' IR instructions.
MachineFunctionPass * createPrintMIRPass(raw_ostream &OS)
MIRPrinting pass - this pass prints out the LLVM IR into the given stream using the MIR serialization...
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...