HomePhabricator

[llvm/Object] - Make dyn_cast<XCOFFObjectFile> work as it should.

Authored by grimar on Aug 25 2020, 7:44 AM.

Description

[llvm/Object] - Make dyn_cast<XCOFFObjectFile> work as it should.

Currently, dyn_cast<XCOFFObjectFile> always does cast and returns a pointer,
even when we pass ELF/Wasm/Mach-O or COFF instead of XCOFF.

It happens because XCOFFObjectFile class does not implement classof.
I've fixed it and added a unit test.

Differential revision: https://reviews.llvm.org/D86542