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.
Paths
| Differential D86542
[llvm/Object] - Make dyn_cast<XCOFFObjectFile> work as it should. ClosedPublic Authored by grimar on Aug 25 2020, 7:55 AM.
Details Summary Currently, dyn_cast<XCOFFObjectFile> always does cast and returns a pointer, It happens because XCOFFObjectFile class does not implement classof.
Diff Detail Event TimelineThis revision is now accepted and ready to land.Aug 25 2020, 11:25 PM This revision is now accepted and ready to land.Aug 26 2020, 3:51 AM This revision is now accepted and ready to land.Aug 26 2020, 4:17 AM Closed by commit rG92c527e5a2b4: [llvm/Object] - Make dyn_cast<XCOFFObjectFile> work as it should. (authored by grimar). · Explain WhyAug 26 2020, 5:10 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 287907 llvm/include/llvm/Object/XCOFFObjectFile.h
llvm/unittests/Object/XCOFFObjectFileTest.cpp
|