[ms] [llvm-ml] Add support for .radix directive, and accept all radix specifiers
authorEric Astor <epastor@google.com>
Tue, 29 Sep 2020 20:17:47 +0000 (16:17 -0400)
committerEric Astor <epastor@google.com>
Tue, 29 Sep 2020 20:55:51 +0000 (16:55 -0400)
commit6b70a83d9cc0ec17aa4bc199081c0a51e65be6dd
tree22cfa3df5405339e0acc920035e197eda1500123
parentf0506e4923cdbd2b53258bc6c3a2b6bc62c8ccc3
[ms] [llvm-ml] Add support for .radix directive, and accept all radix specifiers

Add support for .radix directive, and radix specifiers [yY] (binary), [oOqQ] (octal), and [tT] (decimal).

Also, when lexing MASM integers, require radix specifier; MASM requires that all literals without a radix specifier be treated as in the default radix. (e.g., 0100 = 100)

Relanding D87400, now with fewer ms-inline-asm tests broken!

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D88337
llvm/include/llvm/MC/MCParser/MCAsmLexer.h
llvm/lib/MC/MCParser/AsmLexer.cpp
llvm/lib/MC/MCParser/COFFMasmParser.cpp
llvm/lib/MC/MCParser/MasmParser.cpp
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/test/tools/llvm-ml/radix.test [new file with mode: 0644]
llvm/test/tools/llvm-ml/radix_errors.test [new file with mode: 0644]
llvm/tools/llvm-ml/llvm-ml.cpp