diff options
author | ed <ed@FreeBSD.org> | 2009-07-04 13:58:26 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-07-04 13:58:26 +0000 |
commit | 72621d11de5b873f1695f391eb95f0b336c3d2d4 (patch) | |
tree | 84360c8989c912127a383af37c4b1aa5767bd16e /lib/AsmParser/LLLexer.h | |
parent | cf5cd875b51255602afaed29deb636b66b295671 (diff) | |
download | FreeBSD-src-72621d11de5b873f1695f391eb95f0b336c3d2d4.zip FreeBSD-src-72621d11de5b873f1695f391eb95f0b336c3d2d4.tar.gz |
Import LLVM 74788.
Diffstat (limited to 'lib/AsmParser/LLLexer.h')
-rw-r--r-- | lib/AsmParser/LLLexer.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/AsmParser/LLLexer.h b/lib/AsmParser/LLLexer.h index 995aa4e..b5e58f1 100644 --- a/lib/AsmParser/LLLexer.h +++ b/lib/AsmParser/LLLexer.h @@ -17,17 +17,19 @@ #include "LLToken.h" #include "llvm/ADT/APSInt.h" #include "llvm/ADT/APFloat.h" +#include "llvm/Support/SourceMgr.h" #include <string> namespace llvm { class MemoryBuffer; class Type; - class ParseError; + class SMDiagnostic; class LLLexer { const char *CurPtr; MemoryBuffer *CurBuf; - ParseError &ErrorInfo; + SMDiagnostic &ErrorInfo; + SourceMgr &SM; // Information about the current token. const char *TokStart; @@ -40,15 +42,15 @@ namespace llvm { std::string TheError; public: - explicit LLLexer(MemoryBuffer *StartBuf, ParseError &); + explicit LLLexer(MemoryBuffer *StartBuf, SourceMgr &SM, SMDiagnostic &); ~LLLexer() {} lltok::Kind Lex() { return CurKind = LexToken(); } - typedef const char* LocTy; - LocTy getLoc() const { return TokStart; } + typedef SMLoc LocTy; + LocTy getLoc() const { return SMLoc::getFromPointer(TokStart); } lltok::Kind getKind() const { return CurKind; } const std::string getStrVal() const { return StrVal; } const Type *getTyVal() const { return TyVal; } @@ -58,7 +60,7 @@ namespace llvm { bool Error(LocTy L, const std::string &Msg) const; - bool Error(const std::string &Msg) const { return Error(CurPtr, Msg); } + bool Error(const std::string &Msg) const { return Error(getLoc(), Msg); } std::string getFilename() const; private: |