003 File Manager
Current Path:
/usr/src/contrib/llvm-project/llvm/include/llvm/ExecutionEngine/Orc
usr
/
src
/
contrib
/
llvm-project
/
llvm
/
include
/
llvm
/
ExecutionEngine
/
Orc
/
📁
..
📄
CompileOnDemandLayer.h
(27.24 KB)
📄
CompileUtils.h
(3.29 KB)
📄
Core.h
(55.04 KB)
📄
DebugUtils.h
(4.59 KB)
📄
ExecutionUtils.h
(14.17 KB)
📄
GlobalMappingLayer.h
(4.02 KB)
📄
IRCompileLayer.h
(5.87 KB)
📄
IRTransformLayer.h
(4.85 KB)
📄
IndirectionUtils.h
(20.75 KB)
📄
JITTargetMachineBuilder.h
(5.01 KB)
📄
LLJIT.h
(15.66 KB)
📄
LambdaResolver.h
(3.16 KB)
📄
Layer.h
(6.29 KB)
📄
LazyEmittingLayer.h
(10.08 KB)
📄
LazyReexports.h
(6.64 KB)
📄
Legacy.h
(7.73 KB)
📄
MachOPlatform.h
(5.27 KB)
📄
Mangling.h
(2.31 KB)
📄
NullResolver.h
(1.47 KB)
📄
ObjectLinkingLayer.h
(7.25 KB)
📄
ObjectTransformLayer.h
(5.02 KB)
📄
OrcABISupport.h
(14.54 KB)
📄
OrcError.h
(2.04 KB)
📄
OrcRemoteTargetClient.h
(25.06 KB)
📄
OrcRemoteTargetRPCAPI.h
(11.49 KB)
📄
OrcRemoteTargetServer.h
(17.19 KB)
📁
RPC
📄
RTDyldObjectLinkingLayer.h
(18.95 KB)
📄
RemoteObjectLayer.h
(19.84 KB)
📄
SpeculateAnalyses.h
(2.87 KB)
📄
Speculation.h
(7.31 KB)
📄
SymbolStringPool.h
(5.39 KB)
📄
ThreadSafeModule.h
(5.53 KB)
Editing: JITTargetMachineBuilder.h
//===- JITTargetMachineBuilder.h - Build TargetMachines for JIT -*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // A utitily for building TargetMachines for JITs. // //===----------------------------------------------------------------------===// #ifndef LLVM_EXECUTIONENGINE_ORC_JITTARGETMACHINEBUILDER_H #define LLVM_EXECUTIONENGINE_ORC_JITTARGETMACHINEBUILDER_H #include "llvm/ADT/Optional.h" #include "llvm/ADT/Triple.h" #include "llvm/MC/SubtargetFeature.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/Error.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" #include <memory> #include <string> #include <vector> namespace llvm { class raw_ostream; namespace orc { /// A utility class for building TargetMachines for JITs. class JITTargetMachineBuilder { public: /// Create a JITTargetMachineBuilder based on the given triple. /// /// Note: TargetOptions is default-constructed, then EmulatedTLS and /// ExplicitEmulatedTLS are set to true. If EmulatedTLS is not /// required, these values should be reset before calling /// createTargetMachine. JITTargetMachineBuilder(Triple TT); /// Create a JITTargetMachineBuilder for the host system. /// /// Note: TargetOptions is default-constructed, then EmulatedTLS and /// ExplicitEmulatedTLS are set to true. If EmulatedTLS is not /// required, these values should be reset before calling /// createTargetMachine. static Expected<JITTargetMachineBuilder> detectHost(); /// Create a TargetMachine. /// /// This operation will fail if the requested target is not registered, /// in which case see llvm/Support/TargetSelect.h. To JIT IR the Target and /// the target's AsmPrinter must both be registered. To JIT assembly /// (including inline and module level assembly) the target's AsmParser must /// also be registered. Expected<std::unique_ptr<TargetMachine>> createTargetMachine(); /// Get the default DataLayout for the target. /// /// Note: This is reasonably expensive, as it creates a temporary /// TargetMachine instance under the hood. It is only suitable for use during /// JIT setup. Expected<DataLayout> getDefaultDataLayoutForTarget() { auto TM = createTargetMachine(); if (!TM) return TM.takeError(); return (*TM)->createDataLayout(); } /// Set the CPU string. JITTargetMachineBuilder &setCPU(std::string CPU) { this->CPU = std::move(CPU); return *this; } /// Set the relocation model. JITTargetMachineBuilder &setRelocationModel(Optional<Reloc::Model> RM) { this->RM = std::move(RM); return *this; } /// Get the relocation model. const Optional<Reloc::Model> &getRelocationModel() const { return RM; } /// Set the code model. JITTargetMachineBuilder &setCodeModel(Optional<CodeModel::Model> CM) { this->CM = std::move(CM); return *this; } /// Get the code model. const Optional<CodeModel::Model> &getCodeModel() const { return CM; } /// Set the LLVM CodeGen optimization level. JITTargetMachineBuilder &setCodeGenOptLevel(CodeGenOpt::Level OptLevel) { this->OptLevel = OptLevel; return *this; } /// Set subtarget features. JITTargetMachineBuilder &setFeatures(StringRef FeatureString) { Features = SubtargetFeatures(FeatureString); return *this; } /// Add subtarget features. JITTargetMachineBuilder & addFeatures(const std::vector<std::string> &FeatureVec); /// Access subtarget features. SubtargetFeatures &getFeatures() { return Features; } /// Access subtarget features. const SubtargetFeatures &getFeatures() const { return Features; } /// Set TargetOptions. /// /// Note: This operation will overwrite any previously configured options, /// including EmulatedTLS and ExplicitEmulatedTLS which /// the JITTargetMachineBuilder sets by default. Clients are responsible /// for re-enabling these overwritten options. JITTargetMachineBuilder &setOptions(TargetOptions Options) { this->Options = std::move(Options); return *this; } /// Access TargetOptions. TargetOptions &getOptions() { return Options; } /// Access TargetOptions. const TargetOptions &getOptions() const { return Options; } /// Access Triple. Triple &getTargetTriple() { return TT; } /// Access Triple. const Triple &getTargetTriple() const { return TT; } #ifndef NDEBUG /// Debug-dump a JITTargetMachineBuilder. friend raw_ostream &operator<<(raw_ostream &OS, const JITTargetMachineBuilder &JTMB); #endif private: Triple TT; std::string CPU; SubtargetFeatures Features; TargetOptions Options; Optional<Reloc::Model> RM; Optional<CodeModel::Model> CM; CodeGenOpt::Level OptLevel = CodeGenOpt::Default; }; } // end namespace orc } // end namespace llvm #endif // LLVM_EXECUTIONENGINE_ORC_JITTARGETMACHINEBUILDER_H
Upload File
Create Folder