1 //===-- jitcs_dumper.h - ----------------------------------------*- C++ -*-===//
4 //===----------------------------------------------------------------------===//
6 #ifndef _JITCS_DUMPER_H_
7 #define _JITCS_DUMPER_H_
9 #include "jitcs_adt_ref.h"
10 #include "jitcs_base.h"
16 struct VirtualRegister
;
22 IDumper(const IDumper
&) = delete;
23 IDumper
& operator =(const IDumper
&) = delete;
25 void write(const char*);
26 void writef(const char*, ...);
27 virtual void writev(const char*, va_list) = 0;
29 class PrintFDumper
: public IDumper
{
31 PrintFDumper() = default;
33 PrintFDumper(const PrintFDumper
&) = delete;
34 PrintFDumper
& operator =(const PrintFDumper
&) = delete;
36 /*[[override]]*/ virtual void writev(const char*, va_list);
39 class IMachineDumper
: public IDumper
{
41 IMachineDumper(std::unique_ptr
<IDumper
> &&);
43 IMachineDumper() = delete;
44 IMachineDumper(const IMachineDumper
&) = delete;
45 IMachineDumper
& operator =(const IMachineDumper
&) = delete;
48 virtual void write(Ref
<Instruction
>) = 0;
49 virtual void write(Ref
<VirtualRegister
>) = 0;
51 /*[[override]]*/ virtual void writev(const char*, va_list);
53 std::unique_ptr
<IDumper
> _out
;
56 } // end namespace jitcs