[lld] r280423 - Add comments.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 15:48:05 PDT 2016


Author: ruiu
Date: Thu Sep  1 17:48:05 2016
New Revision: 280423

URL: http://llvm.org/viewvc/llvm-project?rev=280423&view=rev
Log:
Add comments.

Modified:
    lld/trunk/ELF/ScriptParser.cpp

Modified: lld/trunk/ELF/ScriptParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/ScriptParser.cpp?rev=280423&r1=280422&r2=280423&view=diff
==============================================================================
--- lld/trunk/ELF/ScriptParser.cpp (original)
+++ lld/trunk/ELF/ScriptParser.cpp Thu Sep  1 17:48:05 2016
@@ -60,7 +60,7 @@ std::vector<StringRef> ScriptParserBase:
     if (S.empty())
       return Ret;
 
-    // Quoted token
+    // Quoted token.
     if (S.startswith("\"")) {
       size_t E = S.find("\"", 1);
       if (E == StringRef::npos) {
@@ -72,10 +72,12 @@ std::vector<StringRef> ScriptParserBase:
       continue;
     }
 
-    // Unquoted token
+    // Unquoted token. This is more relaxed than tokens in C-like language,
+    // so that you can write "file-name.cpp" as one bare token, for example.
     size_t Pos = S.find_first_not_of(
         "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
         "0123456789_.$/\\~=+[]*?-:!<>");
+
     // A character that cannot start a word (which is usually a
     // punctuation) forms a single character token.
     if (Pos == 0)




More information about the llvm-commits mailing list