[MC] Add .pushsection/.popsection support to COFFAsmParser
authorcynecx <me@cynecx.net>
Wed, 21 Jun 2023 17:39:56 +0000 (10:39 -0700)
committerFangrui Song <i@maskray.me>
Wed, 21 Jun 2023 17:39:56 +0000 (10:39 -0700)
commit63538a087926f9f9dc992918b06be4720f4c59fb
treef247b7e2954e874cda863279a044e76aaa36fe07
parent1704c8d1047d75e0f17736de146281d68fe7b203
[MC] Add .pushsection/.popsection support to COFFAsmParser

The COFFAsmParser (to my surprise) didn't support the .pushsection and
.popsection directives. These directives aren't directly useful, however for
frontends that have inline asm support this is really useful. Rust in
particular, has support for inline asm, which can be used together with these
directives to "emulate" features like static generics. This patch adds support
for the two mentioned directives.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D152085
llvm/lib/MC/MCParser/COFFAsmParser.cpp
llvm/test/MC/COFF/section.s