[lld] [ELF] ScriptLexer: generate tokens lazily (PR #100493)

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 15:07:19 PDT 2024


================
@@ -123,45 +128,52 @@ void ScriptLexer::tokenize(MemoryBufferRef mb) {
     if (s.starts_with("\"")) {
       size_t e = s.find("\"", 1);
       if (e == StringRef::npos) {
-        StringRef filename = mb.getBufferIdentifier();
         size_t lineno = begin.substr(0, s.data() - begin.data()).count('\n');
----------------
igorkudrin wrote:

`s` and `begin` can point to different memory buffers after POPing a buffer from the INCLUDE stack in line 119, no?

https://github.com/llvm/llvm-project/pull/100493


More information about the llvm-commits mailing list