[llvm-commits] [llvm] r98442 - /llvm/trunk/lib/MC/MCParser/AsmLexer.cpp
Chris Lattner
sabre at nondot.org
Sat Mar 13 11:25:13 PST 2010
Author: lattner
Date: Sat Mar 13 13:25:13 2010
New Revision: 98442
URL: http://llvm.org/viewvc/llvm-project?rev=98442&view=rev
Log:
add a hack to allow parsing negative minint. rdar://7751341
Modified:
llvm/trunk/lib/MC/MCParser/AsmLexer.cpp
Modified: llvm/trunk/lib/MC/MCParser/AsmLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmLexer.cpp?rev=98442&r1=98441&r2=98442&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmLexer.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmLexer.cpp Sat Mar 13 13:25:13 2010
@@ -140,8 +140,14 @@
StringRef Result(TokStart, CurPtr - TokStart);
long long Value;
- if (Result.getAsInteger(10, Value))
- return ReturnError(TokStart, "Invalid decimal number");
+ if (Result.getAsInteger(10, Value)) {
+ // We have to handle minint_as_a_positive_value specially, because
+ // - minint_as_a_positive_value = minint and it is valid.
+ if (Result == "9223372036854775808")
+ Value = -9223372036854775808ULL;
+ else
+ return ReturnError(TokStart, "Invalid decimal number");
+ }
return AsmToken(AsmToken::Integer, Result, Value);
}
More information about the llvm-commits
mailing list