[all-commits] [llvm/llvm-project] 3846e3: [RISCV] Generate correct ELF abi flag when empty ....

Wang Pengcheng via All-commits all-commits at lists.llvm.org
Thu Aug 25 23:42:17 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3846e3970feb506f52cf2cc696bb4a530633acc6
      https://github.com/llvm/llvm-project/commit/3846e3970feb506f52cf2cc696bb4a530633acc6
  Author: Yunze Zhu <yunzezhu at linux.alibaba.com>
  Date:   2022-08-26 (Fri, 26 Aug 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
    A llvm/test/CodeGen/RISCV/module-target-abi3.ll

  Log Message:
  -----------
  [RISCV] Generate correct ELF abi flag when empty .ll file has target-abi attribute

In patch D121183, target abi is get from .ll file's target-abi
attribute and set in RISCVAsmPrinter::emitFunctionEntryLabel
function. In https://github.com/llvm/llvm-project/issues/57242,
an api mismatch error may be caused by failing to call function
RISCVAsmPrinter::emitFunctionEntryLabel to set target-abi to
correct one when the .ll is empty or a module has no function.

This patch move setting target-abi part to function
RISCVAsmPrinter::emitStartOfAsmFile, make sure all .ll file and
module in LTO read target-abi from module flag and set, with or
without function.

Signed-off-by: xiaojing.zhang <xiaojing.zhang at xcalibyte.com>
Signed-off-by: jianxin.lai <jianxin.lai at xcalibyte.com>

Reviewed By: luismarques

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




More information about the All-commits mailing list