[all-commits] [llvm/llvm-project] cda23c: [PPC] Fix layering issues between MCTargetDesc and...

Reid Kleckner via All-commits all-commits at lists.llvm.org
Wed Aug 30 16:09:15 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cda23c07328c2d662c14a755a982d165590fbd3c
      https://github.com/llvm/llvm-project/commit/cda23c07328c2d662c14a755a982d165590fbd3c
  Author: Reid Kleckner <rnk at google.com>
  Date:   2023-08-30 (Wed, 30 Aug 2023)

  Changed paths:
    M llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFStreamer.cpp
    M llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp
    M llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
    M llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.h
    M llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
    M llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h
    M llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
    M llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
    M llvm/lib/Target/PowerPC/PPCInstrInfo.h
    M llvm/lib/Target/PowerPC/PPCRegisterInfo.h

  Log Message:
  -----------
  [PPC] Fix layering issues between MCTargetDesc and CodeGen

See issue #64166 for more information about the layering issue.

The PPCMCTargetDesc library was including CodeGen headers such as
PPCInstrInfo.h and calling inline functions in them. This doesn't work
in the Bazel build, and is error-prone. If the inline function moves to
a cpp file, it will result in linker errors.

To address the issue, I moved several inline functions to
PPCMCTargetDesc.cpp, and declared them in the PPC namespace in
PPCMCTargetDesc.h, which seemed like the most straightforward fix.

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




More information about the All-commits mailing list