diff options
Diffstat (limited to 'include/llvm/Object')
-rw-r--r-- | include/llvm/Object/COFF.h | 6 | ||||
-rw-r--r-- | include/llvm/Object/MachO.h | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/Object/COFF.h b/include/llvm/Object/COFF.h index fa8dee7c5d..1dd8f983ec 100644 --- a/include/llvm/Object/COFF.h +++ b/include/llvm/Object/COFF.h @@ -141,6 +141,12 @@ public: virtual uint8_t getBytesInAddress() const; virtual StringRef getFileFormatName() const; virtual unsigned getArch() const; + + + static inline bool classof(const Binary *v) { + return v->getType() == isCOFF; + } + static inline bool classof(const COFFObjectFile *v) { return true; } }; } diff --git a/include/llvm/Object/MachO.h b/include/llvm/Object/MachO.h index 71830aa89b..147987e8f1 100644 --- a/include/llvm/Object/MachO.h +++ b/include/llvm/Object/MachO.h @@ -40,6 +40,11 @@ public: MachOObject *getObject() { return MachOObj; } + static inline bool classof(const Binary *v) { + return v->getType() == isMachO; + } + static inline bool classof(const MachOObjectFile *v) { return true; } + protected: virtual error_code getSymbolNext(DataRefImpl Symb, SymbolRef &Res) const; virtual error_code getSymbolName(DataRefImpl Symb, StringRef &Res) const; |