summaryrefslogtreecommitdiff
path: root/lowlevelilinstruction.h
diff options
context:
space:
mode:
Diffstat (limited to 'lowlevelilinstruction.h')
-rw-r--r--lowlevelilinstruction.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/lowlevelilinstruction.h b/lowlevelilinstruction.h
index 898e72b8..dd416e90 100644
--- a/lowlevelilinstruction.h
+++ b/lowlevelilinstruction.h
@@ -2010,3 +2010,24 @@ namespace BinaryNinja
#undef _STD_UNORDERED_MAP
#undef _STD_MAP
} // namespace BinaryNinjaCore
+
+#ifdef BINARYNINJACORE_LIBRARY
+#define IL_INS_NS BinaryNinjaCore
+#else
+#define IL_INS_NS BinaryNinja
+#endif
+template<> struct fmt::formatter<IL_INS_NS::LowLevelILInstruction>
+{
+ // <empty> -> normal, ? -> debug
+ char presentation = ' ';
+ format_context::iterator format(const IL_INS_NS::LowLevelILInstruction& obj, format_context& ctx) const;
+ constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator
+ {
+ auto it = ctx.begin(), end = ctx.end();
+ if (it != end && *it == '?')
+ presentation = *it++;
+ if (it != end && *it != '}') detail::throw_format_error("invalid format");
+ return it;
+ }
+};
+#undef IL_INS_NS