Commit 3846e397 authored by Yunze Zhu's avatar Yunze Zhu Committed by wangpc
Browse files

[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: default avatarxiaojing.zhang <xiaojing.zhang@xcalibyte.com>
Signed-off-by: default avatarjianxin.lai <jianxin.lai@xcalibyte.com>

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D132204
parent 6b098bf3
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment