[PATCH] D72517: [lld/ELF] PR44498: Support input filename in double quote

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 16 05:45:49 PST 2020


evgeny777 added a comment.

I think that adding extra flag to GlobPattern::create was better idea. Just set it to false by default, so that GlobPattern will still act as glob matcher for all other users:

  static static Expected<GlobPattern> create(StringRef Pat, bool IgnoreMetaChars = false);

Than add extra constructor to StringMatcher to which you'll pass GlobPattern and use it from InputSectionDescription constructor.



================
Comment at: lld/ELF/ScriptParser.cpp:637
 
-    std::vector<StringRef> v;
-    while (!errorCount() && peek() != ")" && peek() != "EXCLUDE_FILE")
-      v.push_back(unquote(next()));
+    bool SectionPatternFound = false;
+    StringMatcher SectionMatcher;
----------------
Add empty() method to StringMatcher and use !SectionMatcher.empty() instead of this flag


================
Comment at: lld/ELF/ScriptParser.cpp:849
       auto *isd = make<InputSectionDescription>(tok);
-      isd->sectionPatterns.push_back({{}, StringMatcher({"*"})});
+      isd->sectionPatterns.push_back({{}, StringMatcher("*")});
       cmd->sectionCommands.push_back(isd);
----------------
What's the purpose of this change?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72517





More information about the llvm-commits mailing list