mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-09 11:32:48 +00:00
Object: Implement casting for concrete classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142314 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7c81013c45
commit
ab6bcf35ae
@ -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; }
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -377,6 +377,11 @@ public:
|
||||
uint64_t getStringTableIndex() const;
|
||||
ELF::Elf64_Word getSymbolTableIndex(const Elf_Sym *symb) const;
|
||||
const Elf_Shdr *getSection(const Elf_Sym *symb) const;
|
||||
|
||||
static inline bool classof(const Binary *v) {
|
||||
return v->getType() == isELF;
|
||||
}
|
||||
static inline bool classof(const ELFObjectFile *v) { return true; }
|
||||
};
|
||||
} // end namespace
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user