diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-02 22:46:18 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-02 22:46:18 +0000 |
commit | 92bcb426c3e4503c99324afd4ed0a73521711a56 (patch) | |
tree | e8f7a3d1a6ec95fa77eb1c5590fa2a5f96ab2075 /lib/AsmParser/LLLexer.cpp | |
parent | 7e1e31f467d87c834d8baf673929865907901313 (diff) |
switch the .ll parser into SMDiagnostic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74734 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/LLLexer.cpp')
-rw-r--r-- | lib/AsmParser/LLLexer.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/AsmParser/LLLexer.cpp b/lib/AsmParser/LLLexer.cpp index b3f7cdb3c3..090e614122 100644 --- a/lib/AsmParser/LLLexer.cpp +++ b/lib/AsmParser/LLLexer.cpp @@ -16,6 +16,7 @@ #include "llvm/Instruction.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/SourceMgr.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Assembly/Parser.h" #include <cstdlib> @@ -38,8 +39,9 @@ bool LLLexer::Error(LocTy ErrorLoc, const std::string &Msg) const { for (const char *FP = CurBuf->getBufferStart(); FP != ErrorLoc; ++FP) if (*FP == '\n') ++LineNo; - std::string LineContents(LineStart, LineEnd); - ErrorInfo.setError(Msg, LineNo, ErrorLoc-LineStart, LineContents); + ErrorInfo = SMDiagnostic(CurBuf->getBufferIdentifier(), + LineNo, ErrorLoc-LineStart, Msg, + std::string(LineStart, LineEnd)); return true; } @@ -195,7 +197,7 @@ static const char *isLabelTail(const char *CurPtr) { // Lexer definition. //===----------------------------------------------------------------------===// -LLLexer::LLLexer(MemoryBuffer *StartBuf, ParseError &Err) +LLLexer::LLLexer(MemoryBuffer *StartBuf, SMDiagnostic &Err) : CurBuf(StartBuf), ErrorInfo(Err), APFloatVal(0.0) { CurPtr = CurBuf->getBufferStart(); } |