mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
Simplify the code and fix a typo.
llvm-svn: 46458
This commit is contained in:
parent
93f785a638
commit
ad2a3eb416
@ -21,13 +21,10 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
static bool isSignedChar(char C) {
|
static bool isSignedChar(char C) {
|
||||||
if (C == '+' || C == '-')
|
return (C == '+' || C == '-');
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isExpoentChar(char C) {
|
static bool isExponentChar(char C) {
|
||||||
switch (C) {
|
switch (C) {
|
||||||
case 'D': // Strange exponential notation.
|
case 'D': // Strange exponential notation.
|
||||||
case 'd': // Strange exponential notation.
|
case 'd': // Strange exponential notation.
|
||||||
@ -42,7 +39,7 @@ static bool isNumberChar(char C) {
|
|||||||
case '0': case '1': case '2': case '3': case '4':
|
case '0': case '1': case '2': case '3': case '4':
|
||||||
case '5': case '6': case '7': case '8': case '9':
|
case '5': case '6': case '7': case '8': case '9':
|
||||||
case '.': return true;
|
case '.': return true;
|
||||||
default: return isSignedChar(C) || isExpoentChar(C);
|
default: return isSignedChar(C) || isExponentChar(C);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,7 +50,7 @@ static char *BackupNumber(char *Pos, char *FirstChar) {
|
|||||||
// Otherwise, return to the start of the number.
|
// Otherwise, return to the start of the number.
|
||||||
while (Pos > FirstChar && isNumberChar(Pos[-1])) {
|
while (Pos > FirstChar && isNumberChar(Pos[-1])) {
|
||||||
--Pos;
|
--Pos;
|
||||||
if (Pos > FirstChar && isSignedChar(Pos[0]) && !isExpoentChar(Pos[-1]))
|
if (Pos > FirstChar && isSignedChar(Pos[0]) && !isExponentChar(Pos[-1]))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return Pos;
|
return Pos;
|
||||||
|
Loading…
Reference in New Issue
Block a user