Removed the non-target independent AsmToken::Register enum constant

from MCAsmLexer.h in preparation of supporting other targets.  Changed the
X86AsmParser code to reflect this by removing AsmLexer::LexPercent and looking
for AsmToken::Percent when parsing in places that used AsmToken::Register.
Then changed X86ATTAsmParser::ParseRegister to parse out registers as an
AsmToken::Percent followed by an AsmToken::Identifier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80929 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Kevin Enderby
2009-09-03 17:15:07 +00:00
parent 73b1ee857b
commit 7b4608dfa0
5 changed files with 12 additions and 25 deletions

View File

@@ -101,17 +101,6 @@ AsmToken AsmLexer::LexIdentifier() {
return AsmToken(AsmToken::Identifier, StringRef(TokStart, CurPtr - TokStart));
}
/// LexPercent: Register: %[a-zA-Z0-9]+
AsmToken AsmLexer::LexPercent() {
if (!isalnum(*CurPtr))
return AsmToken(AsmToken::Percent, StringRef(CurPtr, 1)); // Single %.
while (isalnum(*CurPtr))
++CurPtr;
return AsmToken(AsmToken::Register, StringRef(TokStart, CurPtr - TokStart));
}
/// LexSlash: Slash: /
/// C-Style Comment: /* ... */
AsmToken AsmLexer::LexSlash() {
@@ -298,7 +287,7 @@ AsmToken AsmLexer::LexToken() {
if (*CurPtr == '=')
return ++CurPtr, AsmToken(AsmToken::ExclaimEqual, StringRef(TokStart, 2));
return AsmToken(AsmToken::Exclaim, StringRef(TokStart, 1));
case '%': return LexPercent();
case '%': return AsmToken(AsmToken::Percent, StringRef(TokStart, 1));
case '/': return LexSlash();
case '#': return LexLineComment();
case '"': return LexQuote();