[all-commits] [llvm/llvm-project] ee2c0f: [ms] [llvm-ml] Add a draft MASM parser

Eric Astor via All-commits all-commits at lists.llvm.org
Sun Feb 16 09:31:37 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ee2c0f76d74cc03e54389926c9e626987e1408c3
      https://github.com/llvm/llvm-project/commit/ee2c0f76d74cc03e54389926c9e626987e1408c3
  Author: Eric Astor <epastor at google.com>
  Date:   2020-02-16 (Sun, 16 Feb 2020)

  Changed paths:
    M llvm/include/llvm/MC/MCAsmInfo.h
    M llvm/include/llvm/MC/MCParser/AsmLexer.h
    M llvm/include/llvm/MC/MCParser/MCAsmParser.h
    M llvm/include/llvm/MC/MCStreamer.h
    M llvm/include/llvm/MC/MCTargetOptions.h
    M llvm/lib/MC/MCParser/AsmLexer.cpp
    M llvm/lib/MC/MCParser/AsmParser.cpp
    M llvm/lib/MC/MCParser/CMakeLists.txt
    A llvm/lib/MC/MCParser/COFFMasmParser.cpp
    M llvm/lib/MC/MCParser/MCAsmParser.cpp
    A llvm/lib/MC/MCParser/MasmParser.cpp
    M llvm/lib/MC/MCTargetOptions.cpp
    M llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
    M llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.h
    M llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
    M llvm/test/tools/llvm-ml/basic.test
    A llvm/test/tools/llvm-ml/lit.local.cfg
    M llvm/tools/llvm-ml/llvm-ml.cpp
    M llvm/utils/gn/secondary/llvm/lib/MC/MCParser/BUILD.gn

  Log Message:
  -----------
  [ms] [llvm-ml] Add a draft MASM parser

Summary:
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. Text variables (aka text macros) are expanded in-place wherever the identifier occurs.

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.)

Reviewers: rnk, thakis

Reviewed By: thakis

Subscribers: kerbowa, merge_guards_bot, wuzish, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, mgorny, sbc100, jgravelle-google, hiraditya, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Jim, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits

Tags: #llvm

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




More information about the All-commits mailing list