[all-commits] [llvm/llvm-project] 544535: [RISCV][MC]Add support for Binary MCExpr

Yunzezhu94 via All-commits all-commits at lists.llvm.org
Mon Sep 18 19:52:46 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 544535976df69c9244d72a1a5a31970ca2c1a15f
      https://github.com/llvm/llvm-project/commit/544535976df69c9244d72a1a5a31970ca2c1a15f
  Author: Yunze Zhu <yunzezhu at linux.alibaba.com>
  Date:   2023-09-19 (Tue, 19 Sep 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
    A llvm/test/MC/RISCV/fixups-binary-expression.s
    M llvm/test/MC/RISCV/fixups-invalid.s
    M llvm/test/MC/RISCV/rv32i-aliases-valid.s
    M llvm/test/MC/RISCV/rv64i-aliases-valid.s

  Log Message:
  -----------
  [RISCV][MC]Add support for Binary MCExpr

There is an issue: https://github.com/llvm/llvm-project/issues/64612
This issue happens because in RISCVMCCodeEmitter::getImmOpValue it only handles MCExpr kind Target and SymbolRef.
When code with format like .+ comes in, it comes with MCExpr kind Binary, the fixupkind remains fixup_riscv_invalid and reports error.

This patch make MCExpr kind Binary handled with the same way as MCExpr kind SymbolRef,
so code with binary expression can get correct fixupkind and be used to generate more complex relocation.

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




More information about the All-commits mailing list