[llvm-commits] [llvm] r106723 - /llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp
Chris Lattner
sabre at nondot.org
Thu Jun 24 00:16:25 PDT 2010
Author: lattner
Date: Thu Jun 24 02:16:25 2010
New Revision: 106723
URL: http://llvm.org/viewvc/llvm-project?rev=106723&view=rev
Log:
reduce indentation
Modified:
llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp
Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp?rev=106723&r1=106722&r2=106723&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmLexer.cpp Thu Jun 24 02:16:25 2010
@@ -80,30 +80,25 @@
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 (nextToken.getKind() != AsmToken::Identifier)
+ return AsmToken(lexedToken);
+
- if (regID) {
- lexDefinite();
+ 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<int64_t>(regID));
- }
- else {
- return AsmToken(lexedToken);
- }
- }
- else {
- return AsmToken(lexedToken);
+ StringRef regStr(lexedToken.getString().data(),
+ lexedToken.getString().size() +
+ nextToken.getString().size());
+
+ return AsmToken(AsmToken::Register,
+ regStr,
+ static_cast<int64_t>(regID));
}
+
+ return AsmToken(lexedToken);
}
}
}
More information about the llvm-commits
mailing list