[PATCH] D84300: [LLD][ELF] - Linkerscript: report location for the "unclosed comment in a linker script" error.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 24 01:39:18 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGae4279bd3e8d: [LLD][ELF] - Linkerscript: report location for the "unclosed comment in a… (authored by grimar).
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84300/new/

https://reviews.llvm.org/D84300

Files:
  lld/ELF/ScriptLexer.cpp
  lld/ELF/ScriptLexer.h
  lld/test/ELF/linkerscript/diag6.test


Index: lld/test/ELF/linkerscript/diag6.test
===================================================================
--- lld/test/ELF/linkerscript/diag6.test
+++ lld/test/ELF/linkerscript/diag6.test
@@ -4,4 +4,4 @@
 
 SECTIONS /*
 
-CHECK: error: unclosed comment in a linker script
+CHECK: error: {{.*}}diag6.test:1: unclosed comment in a linker script
Index: lld/ELF/ScriptLexer.h
===================================================================
--- lld/ELF/ScriptLexer.h
+++ lld/ELF/ScriptLexer.h
@@ -24,7 +24,7 @@
 
   void setError(const Twine &msg);
   void tokenize(MemoryBufferRef mb);
-  static StringRef skipSpace(StringRef s);
+  StringRef skipSpace(StringRef s);
   bool atEOF();
   StringRef next();
   StringRef peek();
Index: lld/ELF/ScriptLexer.cpp
===================================================================
--- lld/ELF/ScriptLexer.cpp
+++ lld/ELF/ScriptLexer.cpp
@@ -146,7 +146,7 @@
     if (s.startswith("/*")) {
       size_t e = s.find("*/", 2);
       if (e == StringRef::npos) {
-        error("unclosed comment in a linker script");
+        setError("unclosed comment in a linker script");
         return "";
       }
       s = s.substr(e + 2);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84300.280361.patch
Type: text/x-patch
Size: 1178 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200724/a23926d4/attachment.bin>


More information about the llvm-commits mailing list