[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@xcalibyte.com> Signed-off-by:
jianxin.lai <jianxin.lai@xcalibyte.com> Reviewed By: luismarques Differential Revision: https://reviews.llvm.org/D132204
parent
6b098bf3
Please register or sign in to comment