[all-commits] [llvm/llvm-project] dc3f89: Fix crash on XCore on unused inline in EmitTargetM...

nigelp-xmos via All-commits all-commits at lists.llvm.org
Wed Jun 24 12:48:41 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: dc3f8913d2ad33b1129ea488393e12cc88061aff
      https://github.com/llvm/llvm-project/commit/dc3f8913d2ad33b1129ea488393e12cc88061aff
  Author: Nigel Perks <nigelp at xmos.com>
  Date:   2020-06-24 (Wed, 24 Jun 2020)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenModule.h
    M clang/lib/CodeGen/TargetInfo.cpp
    M clang/lib/CodeGen/TargetInfo.h
    A clang/test/CodeGen/xcore-unused-inline.c

  Log Message:
  -----------
  Fix crash on XCore on unused inline in EmitTargetMetadata

EmitTargetMetadata passed to emitTargetMD a null pointer as returned
from GetGlobalValue, for an unused inline function which has been
removed from the module at that point.

A FIXME in CodeGenModule.cpp commented that the calling code in
EmitTargetMetadata should be moved into the one target that needs it
(XCore). A review comment agreed. So the calling loop has been moved
into the XCore subclass. The check for null is done in that loop.

Differential Revision: https://reviews.llvm.org/D77068




More information about the All-commits mailing list