[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)
commit8915e27704b2afd362a69c6be1111fb06bbcc727
tree068e87c713405ef644808ce4b7e7bb49eea6c289
parent1cb058f77c7b15045c677ef30586fe45c2929010
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174983 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/MCParser/AsmLexer.cpp
test/MC/MachO/direction_labels.s
test/MC/X86/intel-syntax-binary.s [new file with mode: 0644]