diff options
author | Kevin Enderby <enderby@apple.com> | 2010-05-17 23:08:19 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2010-05-17 23:08:19 +0000 |
commit | 0510b48fd97cd37fe6297117d82bacb683c3aa39 (patch) | |
tree | d235dbaa55c275573afa801ef39477e0b861a11e /llvm/lib/MC/MCParser/AsmLexer.cpp | |
parent | 990783e345ee0ddd1f0372c20da0d0c9d884fef6 (diff) | |
download | bcm5719-llvm-0510b48fd97cd37fe6297117d82bacb683c3aa39.tar.gz bcm5719-llvm-0510b48fd97cd37fe6297117d82bacb683c3aa39.zip |
Added support in MC for Directional Local Labels.
llvm-svn: 103989
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmLexer.cpp')
-rw-r--r-- | llvm/lib/MC/MCParser/AsmLexer.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCParser/AsmLexer.cpp b/llvm/lib/MC/MCParser/AsmLexer.cpp index 11833127848..e74eac5f621 100644 --- a/llvm/lib/MC/MCParser/AsmLexer.cpp +++ b/llvm/lib/MC/MCParser/AsmLexer.cpp @@ -132,11 +132,6 @@ AsmToken AsmLexer::LexLineComment() { /// Decimal integer: [1-9][0-9]* /// TODO: FP literal. AsmToken AsmLexer::LexDigit() { - if (*CurPtr == ':') - return ReturnError(TokStart, "FIXME: local label not implemented"); - if (*CurPtr == 'f' || *CurPtr == 'b') - return ReturnError(TokStart, "FIXME: directional label not implemented"); - // Decimal integer: [1-9][0-9]* if (CurPtr[-1] != '0') { while (isdigit(*CurPtr)) @@ -158,6 +153,13 @@ AsmToken AsmLexer::LexDigit() { if (*CurPtr == 'b') { ++CurPtr; + // See if we actually have "0b" as part of something like "jmp 0b\n" + if (CurPtr[0] == '\n') { + --CurPtr; + StringRef Result(TokStart, CurPtr - TokStart); + ++CurPtr; + return AsmToken(AsmToken::Integer, Result, 0); + } const char *NumStart = CurPtr; while (CurPtr[0] == '0' || CurPtr[0] == '1') ++CurPtr; |