diff options
Diffstat (limited to 'src/aarch32/disasm-aarch32.h')
-rw-r--r-- | src/aarch32/disasm-aarch32.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/aarch32/disasm-aarch32.h b/src/aarch32/disasm-aarch32.h index 657136a8..b5ac4976 100644 --- a/src/aarch32/disasm-aarch32.h +++ b/src/aarch32/disasm-aarch32.h @@ -111,6 +111,19 @@ class Disassembler { } }; + class DtPrinter { + DataType dt_; + DataType default_dt_; + + public: + DtPrinter(DataType dt, DataType default_dt) + : dt_(dt), default_dt_(default_dt) {} + friend std::ostream& operator<<(std::ostream& os, DtPrinter dt) { + if (dt.dt_.Is(dt.default_dt_)) return os; + return os << dt.dt_; + } + }; + // TODO: Merge this class with PrintLabel below. This Location class // represents a PC-relative offset, not an address. class Location { @@ -221,6 +234,10 @@ class Disassembler { os_ << size; return *this; } + virtual DisassemblerStream& operator<<(const DtPrinter& cond) { + os_ << cond; + return *this; + } virtual DisassemblerStream& operator<<(const DataType& type) { os_ << type; return *this; |