summaryrefslogtreecommitdiff
path: root/include/llvm/Target/TargetMachine.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Target/TargetMachine.h')
-rw-r--r--include/llvm/Target/TargetMachine.h50
1 files changed, 38 insertions, 12 deletions
diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h
index 97442f9a7849..1ca68c8df63a 100644
--- a/include/llvm/Target/TargetMachine.h
+++ b/include/llvm/Target/TargetMachine.h
@@ -138,9 +138,23 @@ public:
/// Get the pointer size for this target.
///
/// This is the only time the DataLayout in the TargetMachine is used.
- unsigned getPointerSize() const { return DL.getPointerSize(); }
+ unsigned getPointerSize(unsigned AS) const {
+ return DL.getPointerSize(AS);
+ }
+
+ unsigned getPointerSizeInBits(unsigned AS) const {
+ return DL.getPointerSizeInBits(AS);
+ }
+
+ unsigned getProgramPointerSize() const {
+ return DL.getPointerSize(DL.getProgramAddressSpace());
+ }
- /// \brief Reset the target options based on the function's attributes.
+ unsigned getAllocaPointerSize() const {
+ return DL.getPointerSize(DL.getAllocaAddrSpace());
+ }
+
+ /// Reset the target options based on the function's attributes.
// FIXME: Remove TargetOptions that affect per-function code generation
// from TargetMachine.
void resetTargetOptions(const Function &F) const;
@@ -172,18 +186,28 @@ public:
bool shouldAssumeDSOLocal(const Module &M, const GlobalValue *GV) const;
+ /// Returns true if this target uses emulated TLS.
+ bool useEmulatedTLS() const;
+
/// Returns the TLS model which should be used for the given global variable.
TLSModel::Model getTLSModel(const GlobalValue *GV) const;
/// Returns the optimization level: None, Less, Default, or Aggressive.
CodeGenOpt::Level getOptLevel() const;
- /// \brief Overrides the optimization level.
+ /// Overrides the optimization level.
void setOptLevel(CodeGenOpt::Level Level);
void setFastISel(bool Enable) { Options.EnableFastISel = Enable; }
bool getO0WantsFastISel() { return O0WantsFastISel; }
void setO0WantsFastISel(bool Enable) { O0WantsFastISel = Enable; }
+ void setGlobalISel(bool Enable) { Options.EnableGlobalISel = Enable; }
+ void setMachineOutliner(bool Enable) {
+ Options.EnableMachineOutliner = Enable;
+ }
+ void setSupportsDefaultOutlining(bool Enable) {
+ Options.SupportsDefaultOutlining = Enable;
+ }
bool shouldPrintMachineCode() const { return Options.PrintMachineCode; }
@@ -201,14 +225,14 @@ public:
return Options.FunctionSections;
}
- /// \brief Get a \c TargetIRAnalysis appropriate for the target.
+ /// Get a \c TargetIRAnalysis appropriate for the target.
///
/// This is used to construct the new pass manager's target IR analysis pass,
/// set up appropriately for this target machine. Even the old pass manager
/// uses this to answer queries about the IR.
TargetIRAnalysis getTargetIRAnalysis();
- /// \brief Return a TargetTransformInfo for a given function.
+ /// Return a TargetTransformInfo for a given function.
///
/// The returned TargetTransformInfo is specialized to the subtarget
/// corresponding to \p F.
@@ -234,7 +258,7 @@ public:
/// \p MMI is an optional parameter that, if set to non-nullptr,
/// will be used to set the MachineModuloInfo for this PM.
virtual bool addPassesToEmitFile(PassManagerBase &, raw_pwrite_stream &,
- CodeGenFileType,
+ raw_pwrite_stream *, CodeGenFileType,
bool /*DisableVerify*/ = true,
MachineModuleInfo *MMI = nullptr) {
return true;
@@ -281,14 +305,14 @@ public:
class LLVMTargetMachine : public TargetMachine {
protected: // Can only create subclasses.
LLVMTargetMachine(const Target &T, StringRef DataLayoutString,
- const Triple &TargetTriple, StringRef CPU, StringRef FS,
+ const Triple &TT, StringRef CPU, StringRef FS,
const TargetOptions &Options, Reloc::Model RM,
CodeModel::Model CM, CodeGenOpt::Level OL);
void initAsmInfo();
public:
- /// \brief Get a TargetTransformInfo implementation for the target.
+ /// Get a TargetTransformInfo implementation for the target.
///
/// The TTI returned uses the common code generator to answer queries about
/// the IR.
@@ -303,7 +327,8 @@ public:
/// \p MMI is an optional parameter that, if set to non-nullptr,
/// will be used to set the MachineModuloInfofor this PM.
bool addPassesToEmitFile(PassManagerBase &PM, raw_pwrite_stream &Out,
- CodeGenFileType FileType, bool DisableVerify = true,
+ raw_pwrite_stream *DwoOut, CodeGenFileType FileType,
+ bool DisableVerify = true,
MachineModuleInfo *MMI = nullptr) override;
/// Add passes to the specified pass manager to get machine code emitted with
@@ -311,7 +336,7 @@ public:
/// fills the MCContext Ctx pointer which can be used to build custom
/// MCStreamer.
bool addPassesToEmitMC(PassManagerBase &PM, MCContext *&Ctx,
- raw_pwrite_stream &OS,
+ raw_pwrite_stream &Out,
bool DisableVerify = true) override;
/// Returns true if the target is expected to pass all machine verifier
@@ -320,10 +345,11 @@ public:
/// EXPENSIVE_CHECKS is enabled.
virtual bool isMachineVerifierClean() const { return true; }
- /// \brief Adds an AsmPrinter pass to the pipeline that prints assembly or
+ /// Adds an AsmPrinter pass to the pipeline that prints assembly or
/// machine code from the MI representation.
bool addAsmPrinter(PassManagerBase &PM, raw_pwrite_stream &Out,
- CodeGenFileType FileTYpe, MCContext &Context);
+ raw_pwrite_stream *DwoOut, CodeGenFileType FileTYpe,
+ MCContext &Context);
};
} // end namespace llvm