diff options
| author | Eugene Leviant <eleviant@accesssoftek.com> | 2016-11-21 15:49:56 +0000 |
|---|---|---|
| committer | Eugene Leviant <eleviant@accesssoftek.com> | 2016-11-21 15:49:56 +0000 |
| commit | 03ff016666c148c8c4466937a47c39c2eb5cdcba (patch) | |
| tree | 04ccab44d61b03e2b2e00bf4d75c4cfd26909862 /lld/ELF/ScriptParser.h | |
| parent | d752c446129ef42d82ac6111fbacdeacc5df7b4d (diff) | |
| download | bcm5719-llvm-03ff016666c148c8c4466937a47c39c2eb5cdcba.tar.gz bcm5719-llvm-03ff016666c148c8c4466937a47c39c2eb5cdcba.zip | |
[ELF] Better error reporting for linker scripts
Differential revision: https://reviews.llvm.org/D26795
llvm-svn: 287547
Diffstat (limited to 'lld/ELF/ScriptParser.h')
| -rw-r--r-- | lld/ELF/ScriptParser.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lld/ELF/ScriptParser.h b/lld/ELF/ScriptParser.h index e2bdeef7659..6c314a4d12e 100644 --- a/lld/ELF/ScriptParser.h +++ b/lld/ELF/ScriptParser.h @@ -12,6 +12,7 @@ #include "lld/Core/LLVM.h" #include "llvm/ADT/StringRef.h" +#include "llvm/Support/MemoryBuffer.h" #include <utility> #include <vector> @@ -20,11 +21,10 @@ namespace elf { class ScriptParserBase { public: - explicit ScriptParserBase(StringRef S) : Input(S), Tokens(tokenize(S)) {} + explicit ScriptParserBase(MemoryBufferRef MB); -protected: void setError(const Twine &Msg); - static std::vector<StringRef> tokenize(StringRef S); + void tokenize(MemoryBufferRef MB); static StringRef skipSpace(StringRef S); bool atEOF(); StringRef next(); @@ -33,13 +33,13 @@ protected: bool consume(StringRef Tok); void expect(StringRef Expect); - size_t getPos(); - void printErrorPos(); - - StringRef Input; + std::vector<MemoryBufferRef> MBs; std::vector<StringRef> Tokens; size_t Pos = 0; bool Error = false; + +private: + MemoryBufferRef currentBuffer(); }; } // namespace elf |

