[ms] [llvm-ml] Add support for ALIGN, EVEN, and ORG directives
authorEric Astor <epastor@google.com>
Fri, 25 Jun 2021 21:19:39 +0000 (17:19 -0400)
committerEric Astor <epastor@google.com>
Fri, 25 Jun 2021 21:19:45 +0000 (17:19 -0400)
commitc8d0d8a8a16e52bc0d6856f36065f46da19b1713
tree27f1fe6ce5e8167d2e7afe6b8fae58a03135a6e0
parent4cf7c6c6a44dba6d7f3c13059f966412df89fe75
[ms] [llvm-ml] Add support for ALIGN, EVEN, and ORG directives

Match ML.EXE's behavior for ALIGN, EVEN, and ORG directives both at file level and in STRUCTs.

We currently reject negative offsets passed to ORG inside STRUCTs (in ML.EXE and ML64.EXE, they wrap around as for an unsigned 32-bit integer).

Also, if a STRUCT is declared using an ORG directive, no value of that type can be defined.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D92507
llvm/lib/MC/MCParser/MasmParser.cpp
llvm/test/tools/llvm-ml/align_directives.asm [new file with mode: 0644]
llvm/test/tools/llvm-ml/align_errors.asm [new file with mode: 0644]