diff options
author | Chris Lattner <sabre@nondot.org> | 2007-11-19 07:43:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-11-19 07:43:52 +0000 |
commit | 8e769985f4a79240639b9265ea35db1191a10e73 (patch) | |
tree | b2fc0a775056592d9b3be6b11634eff63ac7e582 /utils/TableGen/TGLexer.h | |
parent | ce975c9e129c163a3ce6ca68e2ae95e0f9317e5e (diff) | |
download | external_llvm-8e769985f4a79240639b9265ea35db1191a10e73.zip external_llvm-8e769985f4a79240639b9265ea35db1191a10e73.tar.gz external_llvm-8e769985f4a79240639b9265ea35db1191a10e73.tar.bz2 |
Record the start of the current token, for use in error reporting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44227 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/TGLexer.h')
-rw-r--r-- | utils/TableGen/TGLexer.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/TableGen/TGLexer.h b/utils/TableGen/TGLexer.h index dab68c3..ef786b6 100644 --- a/utils/TableGen/TGLexer.h +++ b/utils/TableGen/TGLexer.h @@ -40,6 +40,7 @@ class TGLexer { // IncludeDirectories - This is the list of directories we should search for // include files in. std::vector<std::string> IncludeDirectories; + const char *TokStart; public: TGLexer(MemoryBuffer *StartBuf); ~TGLexer(); @@ -50,7 +51,10 @@ public: int LexToken(); - void PrintError(const char *Loc, const std::string &Msg) const; + typedef const char* LocationTy; + LocationTy getTokenStart() const { return TokStart; } + + void PrintError(LocationTy Loc, const std::string &Msg) const; std::ostream &err() const; void PrintIncludeStack(std::ostream &OS) const; |