47 if (!TheTarget->hasJIT())
48 return make_error<StringError>(
"Target has no JIT support",
53 Options, RM, CM, OptLevel,
true);
55 return make_error<StringError>(
"Could not allocate target machine",
58 return std::unique_ptr<TargetMachine>(TM);
62 const std::vector<std::string> &FeatureVec) {
63 for (
const auto &
F : FeatureVec)
71 << Indent <<
" Triple = \"" << JTMB.TT.
str() <<
"\"\n"
72 << Indent <<
" CPU = \"" << JTMB.CPU <<
"\"\n"
73 << Indent <<
" Features = \"" << JTMB.Features.
getString() <<
"\"\n"
74 << Indent <<
" Options = <not-printable>\n"
75 << Indent <<
" Relocation Model = ";
99 OS <<
"unspecified (will use target default)";
102 << Indent <<
" Code Model = ";
123 OS <<
"unspecified (will use target default)";
126 << Indent <<
" Optimization Level = ";
127 switch (JTMB.OptLevel) {
142 OS <<
"\n" << Indent <<
"}\n";
This file defines the StringMap class.
Tagged union holding either a T or a Error.
std::string getString() const
Returns features as a string.
void AddFeature(StringRef String, bool Enable=true)
Adds Features.
unsigned UseInitArray
UseInitArray - Use .init_array instead of .ctors for static constructors.
unsigned EmulatedTLS
EmulatedTLS - This flag enables emulated TLS model, using emutls function in the runtime library.
Triple - Helper class for working with autoconf configuration names.
const std::string & str() const
const std::string & getTriple() const
void print(raw_ostream &OS) const
A utility class for building TargetMachines for JITs.
JITTargetMachineBuilder & addFeatures(const std::vector< std::string > &FeatureVec)
Add subtarget features.
SubtargetFeatures & getFeatures()
Access subtarget features.
static Expected< JITTargetMachineBuilder > detectHost()
Create a JITTargetMachineBuilder for the host system.
JITTargetMachineBuilder(Triple TT)
Create a JITTargetMachineBuilder based on the given triple.
Expected< std::unique_ptr< TargetMachine > > createTargetMachine()
Create a TargetMachine.
JITTargetMachineBuilder & setCPU(std::string CPU)
Set the CPU string.
This class implements an extremely fast bulk output stream that can only output to a stream.
const StringMap< bool, MallocAllocator > getHostCPUFeatures()
getHostCPUFeatures - Get the LLVM names for the host CPU features.
StringRef getHostCPUName()
getHostCPUName - Get the LLVM name for the host CPU.
std::string getProcessTriple()
getProcessTriple() - Return an appropriate target triple for generating code to be loaded into the cu...
This is an optimization pass for GlobalISel generic memory operations.
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
static const Target * lookupTarget(StringRef Triple, std::string &Error)
lookupTarget - Lookup a target based on a target triple.