[CSKY] Enable TargetAsmStreamer/ELFStreamer and support asm directive of csky_attribute
authorZi Xuan Wu <zixuan.wu@linux.alibaba.com>
Mon, 7 Mar 2022 10:28:13 +0000 (18:28 +0800)
committerZi Xuan Wu <zixuan.wu@linux.alibaba.com>
Tue, 8 Mar 2022 06:00:38 +0000 (14:00 +0800)
commit32977589019d8339b37ee2abcc015d194fd1fa37
tree7998cb2ac56acdf586ce34110d4a2cfef8980803
parenteddd94c27df609113af1d1b795d8483aa6dd662c
[CSKY] Enable TargetAsmStreamer/ELFStreamer and support asm directive of csky_attribute

Add support of parsing .csky_attribute directive and emit related target attributes in .csky.attribute section.
It does not emit attribute directive in assembly code, so only emit target attributes in ELF streamer.
In ELF streamer, it handles the header EFlag and the csky_attribute section which contains some attribute items.
The EFlag and attribute items are calculated from feature bits based on Subtarget.
12 files changed:
llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
llvm/lib/Target/CSKY/CSKYAsmPrinter.cpp
llvm/lib/Target/CSKY/CSKYAsmPrinter.h
llvm/lib/Target/CSKY/MCTargetDesc/CMakeLists.txt
llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFStreamer.cpp [new file with mode: 0644]
llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFStreamer.h [new file with mode: 0644]
llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCTargetDesc.cpp
llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCTargetDesc.h
llvm/lib/Target/CSKY/MCTargetDesc/CSKYTargetStreamer.cpp [new file with mode: 0644]
llvm/lib/Target/CSKY/MCTargetDesc/CSKYTargetStreamer.h [new file with mode: 0644]
llvm/test/MC/CSKY/attribute.s [new file with mode: 0644]
llvm/test/MC/CSKY/invalid-attribute.s [new file with mode: 0644]