[ms] [llvm-ml] Add support for .radix directive, and accept all radix specifiers
authorEric Astor <epastor@google.com>
Wed, 23 Sep 2020 17:42:22 +0000 (13:42 -0400)
committerEric Astor <epastor@google.com>
Wed, 23 Sep 2020 17:45:58 +0000 (13:45 -0400)
commit5dd1b6d612655c9006ba97a8b6487ded80719b48
treebc9b126b1c7ee01ca752eefb7998c2478623bb6a
parentb3931188fdc84ce2bd93a0770ddc8182d18c5010
[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)

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D87400
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]