14 #ifndef LLVM_TARGET_TARGETMACHINE_H
15 #define LLVM_TARGET_TARGETMACHINE_H
28 class InstrItineraryData;
31 class MachineFunctionInitializer;
37 class MCSubtargetInfo;
41 class TargetLibraryInfo;
42 class TargetFrameLowering;
43 class TargetIRAnalysis;
44 class TargetIntrinsicInfo;
46 class TargetPassConfig;
47 class TargetRegisterInfo;
48 class TargetSelectionDAGInfo;
49 class TargetSubtargetInfo;
50 class TargetTransformInfo;
51 class formatted_raw_ostream;
53 class raw_pwrite_stream;
54 class TargetLoweringObjectFile;
58 class PassManagerBase;
60 using legacy::PassManagerBase;
238 Mangler &Mang,
bool MayAlwaysUsePrivate =
false)
const;
268 bool DisableVerify =
true,
AnalysisID StartBefore =
nullptr,
278 bool DisableVerify =
true)
override;
A parsed version of the target data layout string in and methods for querying it. ...
StringRef getTargetCPU() const
unsigned PrintMachineCode
PrintMachineCode - This flag is enabled when the -print-machineinstrs option is specified on the comm...
void getNameWithPrefix(SmallVectorImpl< char > &Name, const GlobalValue *GV, Mangler &Mang, bool MayAlwaysUsePrivate=false) const
MCTargetOptions MCOptions
Machine level options.
Reloc::Model getRelocationModel() const
Returns the code generation relocation model.
virtual bool addPassesToEmitMC(PassManagerBase &, MCContext *&, raw_pwrite_stream &, bool=true)
Add passes to the specified pass manager to get machine code emitted with the MCJIT.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
unsigned EnableFastISel
EnableFastISel - This flag enables fast-path instruction selection which trades away generated code q...
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with...
unsigned DataSections
Emit data into separate sections.
Analysis pass providing the TargetTransformInfo.
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
void setOptLevel(CodeGenOpt::Level Level) const
Overrides the optimization level.
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
virtual TargetLoweringObjectFile * getObjFileLowering() const
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
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.
unsigned FunctionSections
Emit functions into separate sections.
CodeGenOpt::Level getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
unsigned UniqueSectionNames
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...
CodeModel::Model getCodeModel() const
Returns the code model.
virtual TargetIRAnalysis getTargetIRAnalysis()
Get a TargetIRAnalysis appropriate for the target.
Interface to description of machine instruction set.
This class describes a target machine that is implemented with the LLVM target-independent code gener...
const Target & TheTarget
The Target that this machine was created for.
bool getFunctionSections() const
Return true if functions should be emitted into their own section, corresponding to -ffunction-sectio...
MCSymbol * getSymbol(const GlobalValue *GV, Mangler &Mang) const
Triple - Helper class for working with autoconf configuration names.
bool getDataSections() const
Return true if data objects should be emitted into their own section, corresponds to -fdata-sections...
TargetIntrinsicInfo - Interface to description of machine instruction set.
virtual const TargetSubtargetInfo * getSubtargetImpl(const Function &) const
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
StringRef getTargetFeatureString() const
const DataLayout * getDataLayout() const
Deprecated in 3.7, will be removed in 3.8.
MCCodeGenInfo * CodeGenInfo
Low level target information such as relocation model.
void setRequiresStructuredCFG(bool Value)
void setFastISel(bool Enable)
LLVMTargetMachine(const Target &T, StringRef DataLayoutString, const Triple &TargetTriple, StringRef CPU, StringRef FS, TargetOptions Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
bool getUniqueSectionNames() const
const STC & getSubtarget(const Function &F) const
This method returns a pointer to the specified type of TargetSubtargetInfo.
Target - Wrapper for Target specific information.
virtual bool addPassesToEmitFile(PassManagerBase &, raw_pwrite_stream &, CodeGenFileType, bool=true, AnalysisID=nullptr, AnalysisID=nullptr, AnalysisID=nullptr, MachineFunctionInitializer *=nullptr)
Add passes to the specified pass manager to get the specified file emitted.
unsigned RequireStructuredCFG
const MCRegisterInfo * MRI
TargetSubtargetInfo - Generic base class for all target subtargets.
virtual const TargetIntrinsicInfo * getIntrinsicInfo() const
If intrinsic information is available, return it. If not, return null.
void resetTargetOptions(const Function &F) const
Reset the target options based on the function's attributes.
MCSubtargetInfo - Generic base class for all target subtargets.
cl::opt< std::string > StopAfter("stop-after", cl::desc("Stop compilation after a specific pass"), cl::value_desc("pass-name"), cl::init(""))
cl::opt< std::string > StartAfter("start-after", cl::desc("Resume compilation after a specific pass"), cl::value_desc("pass-name"), cl::init(""))
const MCSubtargetInfo * getMCSubtargetInfo() const
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"), clEnumValEnd))
bool getAsmVerbosityDefault() const
Returns the default value of asm verbosity.
const DataLayout createDataLayout() const
Create a DataLayout.
bool shouldPrintMachineCode() const
An abstract base class for streams implementations that also support a pwrite operation.
TLSModel::Model getTLSModel(const GlobalValue *GV) const
Returns the TLS model which should be used for the given global variable.
const DataLayout DL
For ABI type size and alignment.
LLVM Value Representation.
const Target & getTarget() const
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
This interface provides a way to initialize machine functions after they are created by the machine f...
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.
bool addPassesToEmitFile(PassManagerBase &PM, raw_pwrite_stream &Out, CodeGenFileType FileType, bool DisableVerify=true, AnalysisID StartBefore=nullptr, AnalysisID StartAfter=nullptr, AnalysisID StopAfter=nullptr, MachineFunctionInitializer *MFInitializer=nullptr) override
Add passes to the specified pass manager to get the specified file emitted.
bool requiresStructuredCFG() const