summaryrefslogtreecommitdiff
path: root/lib/AsmParser/LLLexer.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-02 23:08:13 +0000
committerChris Lattner <sabre@nondot.org>2009-07-02 23:08:13 +0000
commiteeb4a84ac8d91fb1d5a7c484a1c7047409faee30 (patch)
treea74754636cc687794c2d224169dec37702cc34be /lib/AsmParser/LLLexer.h
parent92bcb426c3e4503c99324afd4ed0a73521711a56 (diff)
downloadllvm-eeb4a84ac8d91fb1d5a7c484a1c7047409faee30.tar.gz
llvm-eeb4a84ac8d91fb1d5a7c484a1c7047409faee30.tar.bz2
llvm-eeb4a84ac8d91fb1d5a7c484a1c7047409faee30.tar.xz
switch the .ll parser to use SourceMgr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74735 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/LLLexer.h')
-rw-r--r--lib/AsmParser/LLLexer.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/AsmParser/LLLexer.h b/lib/AsmParser/LLLexer.h
index 49a63a1692..b5e58f1418 100644
--- a/lib/AsmParser/LLLexer.h
+++ b/lib/AsmParser/LLLexer.h
@@ -17,6 +17,7 @@
#include "LLToken.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/APFloat.h"
+#include "llvm/Support/SourceMgr.h"
#include <string>
namespace llvm {
@@ -28,6 +29,7 @@ namespace llvm {
const char *CurPtr;
MemoryBuffer *CurBuf;
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, SMDiagnostic &);
+ 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: