From 451490145924d229233b2fe2c16edc00de773f55 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 14 Jun 2024 15:07:08 -0400 Subject: [PATCH] xo-jit: + display + display_string --- include/xo/jit/Jit.hpp | 11 ++++++++++- src/jit/Jit.cpp | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/include/xo/jit/Jit.hpp b/include/xo/jit/Jit.hpp index 4c1f1534..044343b8 100644 --- a/include/xo/jit/Jit.hpp +++ b/include/xo/jit/Jit.hpp @@ -59,6 +59,9 @@ namespace xo { llvm::Value * codegen(ref::brw expr); + virtual void display(std::ostream & os) const; + virtual std::string display_string() const; + private: Jit(); @@ -83,7 +86,13 @@ namespace xo { * corresponding llvm interactor **/ std::map nested_env_; - }; + }; /*Jit*/ + + inline std::ostream & + operator<<(std::ostream & os, const Jit & x) { + x.display(os); + return os; + } } /*namespace jit*/ } /*namespace xo*/ diff --git a/src/jit/Jit.cpp b/src/jit/Jit.cpp index d9fc0f61..32bf55d4 100644 --- a/src/jit/Jit.cpp +++ b/src/jit/Jit.cpp @@ -244,6 +244,15 @@ namespace xo { return nullptr; } /*codegen*/ + void + Jit::display(std::ostream & os) const { + os << ""; + } + + std::string + Jit::display_string() const { + return tostr(*this); + } } /*namespace jit*/ } /*namespace xo*/