diff options
author | Chris Lattner <sabre@nondot.org> | 2009-06-21 19:22:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-06-21 19:22:49 +0000 |
commit | 4226bb02fb623e2aa39cad819140df541f95bd8b (patch) | |
tree | a064cfa1a3c076a471d54762de88bb064bbee38f /utils/TableGen | |
parent | 4651bca31bdad27184fa0d36640bf5ef1d83cf5c (diff) | |
download | external_llvm-4226bb02fb623e2aa39cad819140df541f95bd8b.zip external_llvm-4226bb02fb623e2aa39cad819140df541f95bd8b.tar.gz external_llvm-4226bb02fb623e2aa39cad819140df541f95bd8b.tar.bz2 |
simplify some error recovery stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73856 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/TGLexer.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/utils/TableGen/TGLexer.cpp b/utils/TableGen/TGLexer.cpp index 27669ca..976c123 100644 --- a/utils/TableGen/TGLexer.cpp +++ b/utils/TableGen/TGLexer.cpp @@ -15,7 +15,6 @@ #include "llvm/Support/SourceMgr.h" #include "llvm/Support/Streams.h" #include "llvm/Support/MemoryBuffer.h" -#include <ostream> #include "llvm/Config/config.h" #include <cctype> #include <cstdio> @@ -353,19 +352,19 @@ tgtok::TokKind TGLexer::LexNumber() { // Requires at least one hex digit. if (CurPtr == NumStart) - return ReturnError(CurPtr-2, "Invalid hexadecimal number"); + return ReturnError(TokStart, "Invalid hexadecimal number"); errno = 0; CurIntVal = strtoll(NumStart, 0, 16); if (errno == EINVAL) - return ReturnError(CurPtr-2, "Invalid hexadecimal number"); + return ReturnError(TokStart, "Invalid hexadecimal number"); if (errno == ERANGE) { errno = 0; CurIntVal = (int64_t)strtoull(NumStart, 0, 16); if (errno == EINVAL) - return ReturnError(CurPtr-2, "Invalid hexadecimal number"); + return ReturnError(TokStart, "Invalid hexadecimal number"); if (errno == ERANGE) - return ReturnError(CurPtr-2, "Hexadecimal number out of range"); + return ReturnError(TokStart, "Hexadecimal number out of range"); } return tgtok::IntVal; } else if (CurPtr[0] == 'b') { |