[ms] [llvm-ml] Make variable redefinition match ML.EXE
authorEric Astor <epastor@google.com>
Thu, 10 Jun 2021 12:35:41 +0000 (08:35 -0400)
committerEric Astor <epastor@google.com>
Thu, 10 Jun 2021 12:36:15 +0000 (08:36 -0400)
commit00ebbedd1c92f7461f81e79bd1474e894fd25378
tree4474d1dbb0deadf4551e74a80153f959abbabf9a
parent3c1f0e9ef89f7c49fdf383e6b01a61be04614a38
[ms] [llvm-ml] Make variable redefinition match ML.EXE

MASM specifies that all variable definitions are redefinable, except for EQU definitions to expressions. (TEXTEQU is unspecified, but appears to be fully redefinable as well.)

Also, in practice, ML.EXE allows redefinitions where the value doesn't change.

Make variable redefinition possible for text macros, suppressing expansion if written as the first argument to an EQU or TEXTEQU directive.

Reviewed By: thakis

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