[ms] [llvm-ml] Allow arbitrary strings as integer constants
authorEric Astor <epastor@google.com>
Fri, 6 Nov 2020 20:18:15 +0000 (15:18 -0500)
committerEric Astor <epastor@google.com>
Fri, 6 Nov 2020 22:15:49 +0000 (17:15 -0500)
commit5afb36080809567edf5a7936821dcac5a064527b
tree989965fe8bf66230b2aa07ccb6bf4248efa8ac3b
parentbabc224c5d747ace8601ded9f68f5ff5aaf76bf4
[ms] [llvm-ml] Allow arbitrary strings as integer constants

MASM interprets strings in expression contexts as integers expressed in big-endian base-256, treating each character as its ASCII representation.

This completely eliminates the need to special-case single-character strings.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D90788
llvm/lib/MC/MCParser/MasmParser.cpp
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/test/tools/llvm-ml/strings.test
llvm/test/tools/llvm-ml/strings_errors.test [new file with mode: 0644]