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
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 @@
// 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 @@
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;