[all-commits] [llvm/llvm-project] 328cfa: [RISCV] Add an option to emit the Tag_RISCV_arch a...

Craig Topper via All-commits all-commits at lists.llvm.org
Thu Apr 20 10:00:55 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 328cfa840d791deeed84aa4e2fda93d591bfb8d7
      https://github.com/llvm/llvm-project/commit/328cfa840d791deeed84aa4e2fda93d591bfb8d7
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-04-20 (Thu, 20 Apr 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.cpp
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.h
    M llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
    M llvm/test/MC/RISCV/attribute.s
    A llvm/test/MC/RISCV/default-build-attributes.s

  Log Message:
  -----------
  [RISCV] Add an option to emit the Tag_RISCV_arch attribute based on the assembler's subtarget

This adds an option to emit the command line -mattr/-march into the
attributes of an object file. This can be useful to get objdump to
disassemble instructions that aren't in the base without forcing
users to add a .attribute to the assembly file.

The binutils assembler does this by default.

Similar option exists for ARM. I will wire it to a clang option in
another patch. Similar to https://reviews.llvm.org/D31813

Reviewed By: asb, kito-cheng

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




More information about the All-commits mailing list