From 02758a44e41564aafa0e50843aaedafe6b3ed7b3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 24 Jun 2010 07:16:25 +0000 Subject: [PATCH] reduce indentation git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106723 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/AsmParser/X86AsmLexer.cpp | 37 ++++++++++-------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/lib/Target/X86/AsmParser/X86AsmLexer.cpp b/lib/Target/X86/AsmParser/X86AsmLexer.cpp index a58f58e0332..92a1e1db7d2 100644 --- a/lib/Target/X86/AsmParser/X86AsmLexer.cpp +++ b/lib/Target/X86/AsmParser/X86AsmLexer.cpp @@ -80,30 +80,25 @@ AsmToken X86AsmLexer::LexTokenATT() { case AsmToken::Error: SetError(Lexer->getErrLoc(), Lexer->getErr()); return AsmToken(lexedToken); - case AsmToken::Percent: - { + case AsmToken::Percent: { const AsmToken &nextToken = lexTentative(); - if (nextToken.getKind() == AsmToken::Identifier) { - unsigned regID = MatchRegisterName(nextToken.getString()); - - if (regID) { - lexDefinite(); - - StringRef regStr(lexedToken.getString().data(), - lexedToken.getString().size() + - nextToken.getString().size()); - - return AsmToken(AsmToken::Register, - regStr, - static_cast(regID)); - } - else { - return AsmToken(lexedToken); - } - } - else { + if (nextToken.getKind() != AsmToken::Identifier) return AsmToken(lexedToken); + + + if (unsigned regID = MatchRegisterName(nextToken.getString())) { + lexDefinite(); + + StringRef regStr(lexedToken.getString().data(), + lexedToken.getString().size() + + nextToken.getString().size()); + + return AsmToken(AsmToken::Register, + regStr, + static_cast(regID)); } + + return AsmToken(lexedToken); } } }