summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2018-09-30 19:12:23 +0000
committerLang Hames <lhames@gmail.com>2018-09-30 19:12:23 +0000
commitd435ce4343267e147289aa8d8264d308c6639647 (patch)
tree6172459f46f6491e0f081233b485dbbf9745b6a1 /llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
parent0f8f0d6d1df8d17765ea5b34b117d85142b2bf24 (diff)
downloadbcm5719-llvm-d435ce4343267e147289aa8d8264d308c6639647.tar.gz
bcm5719-llvm-d435ce4343267e147289aa8d8264d308c6639647.zip
[ORC] Extract and tidy up JITTargetMachineBuilder, add unit test.
(1) Adds comments for the API. (2) Removes the setArch method: This is redundant: the setArchStr method on the triple should be used instead. (3) Turns EmulatedTLS on by default. This matches EngineBuilder's behavior. llvm-svn: 343423
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
index bb32b3d82e6..e9e27453c32 100644
--- a/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
@@ -19,45 +19,6 @@
namespace llvm {
namespace orc {
-JITTargetMachineBuilder::JITTargetMachineBuilder(Triple TT)
- : TT(std::move(TT)) {}
-
-Expected<JITTargetMachineBuilder> JITTargetMachineBuilder::detectHost() {
- return JITTargetMachineBuilder(Triple(sys::getProcessTriple()));
-}
-
-Expected<std::unique_ptr<TargetMachine>>
-JITTargetMachineBuilder::createTargetMachine() {
- if (!Arch.empty()) {
- Triple::ArchType Type = Triple::getArchTypeForLLVMName(Arch);
-
- if (Type == Triple::UnknownArch)
- return make_error<StringError>(std::string("Unknown arch: ") + Arch,
- inconvertibleErrorCode());
- }
-
- std::string ErrMsg;
- auto *TheTarget = TargetRegistry::lookupTarget(TT.getTriple(), ErrMsg);
- if (!TheTarget)
- return make_error<StringError>(std::move(ErrMsg), inconvertibleErrorCode());
-
- auto *TM =
- TheTarget->createTargetMachine(TT.getTriple(), CPU, Features.getString(),
- Options, RM, CM, OptLevel, /*JIT*/ true);
- if (!TM)
- return make_error<StringError>("Could not allocate target machine",
- inconvertibleErrorCode());
-
- return std::unique_ptr<TargetMachine>(TM);
-}
-
-JITTargetMachineBuilder &JITTargetMachineBuilder::addFeatures(
- const std::vector<std::string> &FeatureVec) {
- for (const auto &F : FeatureVec)
- Features.AddFeature(F);
- return *this;
-}
-
CtorDtorIterator::CtorDtorIterator(const GlobalVariable *GV, bool End)
: InitList(
GV ? dyn_cast_or_null<ConstantArray>(GV->getInitializer()) : nullptr),
OpenPOWER on IntegriCloud