[ms-inline asm] Add support for lexing binary integers with a [bB] suffix.
authorChad Rosier <mcrosier@apple.com>
Tue, 12 Feb 2013 18:29:02 +0000 (18:29 +0000)
committerChad Rosier <mcrosier@apple.com>
Tue, 12 Feb 2013 18:29:02 +0000 (18:29 +0000)
commitf72d06a9197124a37bcf5d27b80b7f9f64f0a549
treec71af34307ccc5832ec59aaaaab78cf228249cba
parent1c3e3c143306669905fb7ca7afaf5231d7285711
[ms-inline asm] Add support for lexing binary integers with a [bB] suffix.

This is complicated by backward labels (e.g., 0b can be both a backward label
and a binary zero).  The current implementation assumes [0-9]b is always a
label and thus it's possible for 0b and 1b to not be interpreted correctly for
ms-style inline assembly.  However, this is relatively simple to fix in the
inline assembly (i.e., drop the [bB]).

This patch also limits backward labels to [0-9]b, so that only 0b and 1b are
ambiguous.
Part of rdar://12470373

llvm-svn: 174983
llvm/lib/MC/MCParser/AsmLexer.cpp
llvm/test/MC/MachO/direction_labels.s
llvm/test/MC/X86/intel-syntax-binary.s [new file with mode: 0644]