diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-09-26 04:19:11 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-09-26 04:19:11 +0000 |
| commit | 1e130489b3a68834fedd8a957def1c8e4adbb447 (patch) | |
| tree | 27953342d78541a49b81b9b7fdbae9a22120ae2d /clang/lib/Lex | |
| parent | 6ad26d3364537431763175250c821a5d71911897 (diff) | |
| download | bcm5719-llvm-1e130489b3a68834fedd8a957def1c8e4adbb447.tar.gz bcm5719-llvm-1e130489b3a68834fedd8a957def1c8e4adbb447.zip | |
Replace a bool with an enum for clarity, based on review comment from James Dennett.
llvm-svn: 191420
Diffstat (limited to 'clang/lib/Lex')
| -rw-r--r-- | clang/lib/Lex/LiteralSupport.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp index e2ff6d6317b..fce3ff3f5fa 100644 --- a/clang/lib/Lex/LiteralSupport.cpp +++ b/clang/lib/Lex/LiteralSupport.cpp @@ -498,19 +498,19 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, hadError = true; return; } else if (*s == '.') { - checkSeparator(TokLoc, s, true); + checkSeparator(TokLoc, s, CSK_AfterDigits); s++; saw_period = true; - checkSeparator(TokLoc, s, false); + checkSeparator(TokLoc, s, CSK_BeforeDigits); s = SkipDigits(s); } if ((*s == 'e' || *s == 'E')) { // exponent - checkSeparator(TokLoc, s, true); + checkSeparator(TokLoc, s, CSK_AfterDigits); const char *Exponent = s; s++; saw_exponent = true; if (*s == '+' || *s == '-') s++; // sign - checkSeparator(TokLoc, s, false); + checkSeparator(TokLoc, s, CSK_BeforeDigits); const char *first_non_digit = SkipDigits(s); if (first_non_digit != s) { s = first_non_digit; @@ -524,7 +524,7 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, } SuffixBegin = s; - checkSeparator(TokLoc, s, true); + checkSeparator(TokLoc, s, CSK_AfterDigits); // Parse the suffix. At this point we can classify whether we have an FP or // integer constant. @@ -682,8 +682,9 @@ bool NumericLiteralParser::isValidUDSuffix(const LangOptions &LangOpts, } void NumericLiteralParser::checkSeparator(SourceLocation TokLoc, - const char *Pos, bool IsAfterDigits) { - if (IsAfterDigits) { + const char *Pos, + CheckSeparatorKind IsAfterDigits) { + if (IsAfterDigits == CSK_AfterDigits) { assert(Pos != ThisTokBegin); --Pos; } else { |

