40 cl::desc(
"Enable generating trap for unreachable"));
58 assert(TmpAsmInfo &&
"MCAsmInfo not initialized. " 59 "Make sure you include the correct TargetSelect.h" 60 "and that InitializeAllTargetMCs() is being invoked!");
100 bool DisableVerify,
bool &WillCompleteCodeGenPipeline,
117 if (!WillCompleteCodeGenPipeline)
136 std::unique_ptr<MCStreamer> AsmStreamer;
144 std::unique_ptr<MCCodeEmitter> MCE;
146 MCE.reset(
getTarget().createMCCodeEmitter(MII, MRI, Context));
148 std::unique_ptr<MCAsmBackend> MAB(
150 auto FOut = llvm::make_unique<formatted_raw_ostream>(Out);
155 AsmStreamer.
reset(S);
171 AsmStreamer.reset(
getTarget().createMCObjectStreamer(
172 T, Context, std::unique_ptr<MCAsmBackend>(MAB),
204 bool WillCompleteCodeGenPipeline =
true;
206 this, PM, DisableVerify, WillCompleteCodeGenPipeline, Out, MMI);
210 if (WillCompleteCodeGenPipeline &&
225 bool DisableVerify) {
227 bool WillCompleteCodeGenPipeline =
true;
229 WillCompleteCodeGenPipeline, Out,
233 assert(WillCompleteCodeGenPipeline &&
"CodeGen pipeline has been altered");
250 std::unique_ptr<MCStreamer> AsmStreamer(
getTarget().createMCObjectStreamer(
const MCRegisterInfo * getMCRegisterInfo() const
StringRef getTargetFeatureString() const
MCTargetOptions MCOptions
Machine level options.
Compute iterated dominance frontiers using a linear time algorithm.
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.
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.
static MCContext * addPassesToGenerateCode(LLVMTargetMachine *TM, PassManagerBase &PM, bool DisableVerify, bool &WillCompleteCodeGenPipeline, raw_pwrite_stream &Out, MachineModuleInfo *MMI)
addPassesToX helper drives creation and initialization of TargetPassConfig.
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.
const MCAsmInfo * AsmInfo
Contains target specific asm information.
Context object for machine code objects.
virtual void addMachinePasses()
Add the complete, standard set of LLVM CodeGen passes.
const MCSubtargetInfo * STI
const MCContext & getContext() const
static cl::opt< bool > EnableTrapUnreachable("trap-unreachable", cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::desc("Enable generating trap for unreachable"))
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...
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...
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.
Interface to description of machine instruction set.
FunctionPass * createFreeMachineFunctionPass()
This pass frees the memory occupied by the MachineFunction.
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.
bool addPassesToEmitFile(PassManagerBase &PM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, bool DisableVerify=true, MachineModuleInfo *MMI=nullptr) override
Add passes to the specified pass manager to get the specified file emitted.
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...
MCAsmInfo * createMCAsmInfo(const MCRegisterInfo &MRI, StringRef TheTriple) const
createMCAsmInfo - Create a MCAsmInfo implementation for the specified target triple.
Target - Wrapper for Target specific information.
unsigned RelaxELFRelocations
const MCRegisterInfo * MRI
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
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)
bool willCompleteCodeGenPipeline() const
Check if the codegen pipeline is limited in such a way that it won't be complete. ...
StringRef - Represent a constant reference to a string, i.e.
unsigned TrapUnreachable
Emit target-specific trap instruction for 'unreachable' IR instructions.
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit...
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.