diff --git a/include/xo/jit/KaleidoscopeJit.hpp b/include/xo/jit/KaleidoscopeJit.hpp index 97f65358..f3d2ebcd 100644 --- a/include/xo/jit/KaleidoscopeJit.hpp +++ b/include/xo/jit/KaleidoscopeJit.hpp @@ -111,6 +111,10 @@ namespace xo { std::move(*data_layout)); } + const std::string & target_triple() const { + return xsession_->getTargetTriple().getTriple(); + } + const DataLayout & data_layout() const { return data_layout_; } JITDylib &getMainJITDylib() { return MainJD; } diff --git a/src/jit/Jit.cpp b/src/jit/Jit.cpp index dafbd07e..f1e00828 100644 --- a/src/jit/Jit.cpp +++ b/src/jit/Jit.cpp @@ -89,10 +89,15 @@ namespace xo { ir_pipeline_ = new IrPipeline(llvm_cx_); } /*recreate_llvm_ir_pipeline*/ + /** identifies target host/architecture for machine code. + * e.g. "x86_64-unknown-linux-gnu" + **/ const std::string & Jit::target_triple() const { // although this getter is defined, seems to be empty in practice - return llvm_module_->getTargetTriple(); + //return llvm_module_->getTargetTriple(); + + return kal_jit_->target_triple(); } std::vector