From 97aea9d513cecd801b8c620c66e65220dbaaef88 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 19 Jun 2024 18:20:53 -0400 Subject: [PATCH] xo-jit: + Jit::mangle() --- include/xo/jit/Jit.hpp | 7 ++++++- include/xo/jit/MachPipeline.hpp | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/xo/jit/Jit.hpp b/include/xo/jit/Jit.hpp index 1847084a..6a160323 100644 --- a/include/xo/jit/Jit.hpp +++ b/include/xo/jit/Jit.hpp @@ -126,9 +126,14 @@ namespace xo { std::move(ts_module)); } + /** report mangled symbol name **/ + auto mangle(StringRef name) { + return this->mangler_(name.str()); + } + llvm::Expected lookup(StringRef name) { return this->xsession_->lookup({&dest_dynamic_lib_}, - this->mangler_(name.str())); + this->mangle(name)); } /* dump */ diff --git a/include/xo/jit/MachPipeline.hpp b/include/xo/jit/MachPipeline.hpp index 3f217db3..967e3127 100644 --- a/include/xo/jit/MachPipeline.hpp +++ b/include/xo/jit/MachPipeline.hpp @@ -95,6 +95,9 @@ namespace xo { /** dump text description of module contents to console **/ void dump_current_module(); + /** report mangle symbol **/ + std::string mangle(const std::string & x) const; + /** lookup symbol in jit-associated output library **/ llvm::Expected lookup_symbol(const std::string & x);