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.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Please include more diff context. See https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface
Thanks. This extension looks reasonable to me.
These directives aren't directly useful, however for frontends that have inline asm support this is really useful.
Agree. If you know which frontend is going to use this, consider mentioning it, otherwise I'll just assume some Clang users will adopt the feature.
llvm/lib/MC/MCParser/COFFAsmParser.cpp | ||
---|---|---|
71 | Add this after addDirectiveHandler<&COFFAsmParser::ParseDirectiveSection>(".section"); | |
371 | While changing signature, consider fixing the function case to camelCase. | |
llvm/test/MC/COFF/section.s | ||
216 | Add some tests with arguments (including section flags)? |
Agree. If you know which frontend is going to use this, consider mentioning it, otherwise I'll just assume some Clang users will adopt the feature.
I've updated the description.
Thank You for reviewing this :)
The build failure seems unrelated (something in flang is failing, which I haven't touched here).
@MaskRay It would be great if you could commit these changes since I don't have commit access :)
Add this after addDirectiveHandler<&COFFAsmParser::ParseDirectiveSection>(".section");