[PATCH] D72680: [ms] [llvm-ml] Add a draft MASM parser
Eric Astor via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 13 20:40:39 PST 2020
epastor created this revision.
Herald added subscribers: llvm-commits, luismarques, apazos, sameer.abuasal, pzheng, s.egerton, lenary, Jim, jsji, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, atanasyan, edward-jones, zzheng, MaskRay, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, fedor.sergeev, kbarton, aheejin, hiraditya, jgravelle-google, sbc100, mgorny, nhaehnle, jvesely, nemanjai, sdardis, dylanmckay, jyknight, dschuff, arsenm.
Herald added a project: LLVM.
epastor added a parent revision: D72679: [ms] [llvm-ml] Add placeholder for llvm-ml, based on llvm-mc.
Herald added a subscriber: wuzish.
Many directives are unavailable, and support for others may be limited.
This first draft has preliminary support for:
- conditional directives (including errors),
- data allocation (unsigned types up to 8 bytes, and ALIGN),
- equates/variables (numeric and text),
- and procedure directives (without parameters),
as well as COMMENT, ECHO, INCLUDE, INCLUDELIB, PUBLIC, and EXTERN.
We deliberately ignore all ml.exe processor directives.
Prominent features not yet supported:
- structs
- macros (both procedures and functions)
- procedures (with specified parameters)
- substitution & expansion operators
Conditional directives are complicated by the fact that "ifdef rax" is a valid way to check if a file is being assembled for a 64-bit x86 processor; we add support for "ifdef <register>" in general, which requires adding a tryParseRegister method to all MCTargetAsmParsers. (Some targets require backtracking in the non-register case.)
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D72680
Files:
llvm/include/llvm/MC/MCAsmInfo.h
llvm/include/llvm/MC/MCParser/AsmLexer.h
llvm/include/llvm/MC/MCParser/MCAsmParser.h
llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
llvm/include/llvm/MC/MCStreamer.h
llvm/lib/MC/MCAsmInfoCOFF.cpp
llvm/lib/MC/MCParser/AsmLexer.cpp
llvm/lib/MC/MCParser/AsmParser.cpp
llvm/lib/MC/MCParser/CMakeLists.txt
llvm/lib/MC/MCParser/COFFMasmParser.cpp
llvm/lib/MC/MCParser/MCAsmParser.cpp
llvm/lib/MC/MCParser/MasmParser.cpp
llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp
llvm/lib/Target/BPF/AsmParser/BPFAsmParser.cpp
llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
llvm/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp
llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp
llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
llvm/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp
llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/tools/llvm-ml/llvm-ml.cpp
llvm/utils/gn/secondary/llvm/lib/MC/MCParser/BUILD.gn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72680.237842.patch
Type: text/x-patch
Size: 186426 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200114/d27e06d6/attachment-0001.bin>
More information about the llvm-commits
mailing list