[all-commits] [llvm/llvm-project] 92c527: [llvm/Object] - Make dyn_cast<XCOFFObjectFile> wor...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Wed Aug 26 05:10:46 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 92c527e5a2b49fb1213ceda97738d4caf414666a
      https://github.com/llvm/llvm-project/commit/92c527e5a2b49fb1213ceda97738d4caf414666a
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-08-26 (Wed, 26 Aug 2020)

  Changed paths:
    M llvm/include/llvm/Object/XCOFFObjectFile.h
    M llvm/unittests/Object/XCOFFObjectFileTest.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list