[PATCH] D17290: [ELF] - Teach input section wildcard patterns to recognize '?' meta character.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 11:52:40 PST 2016


ruiu added inline comments.

================
Comment at: ELF/LinkerScript.cpp:58-63
@@ -57,4 +57,8 @@
 
-// Returns true if S matches T. S may contain a meta character '*'
-// which matches zero or more occurrences of any character.
-static bool matchStr(StringRef S, StringRef T) {
+// Returns true if wildcard pattern W matches T.
+// W may contain next meta characters:
+// '*' which matches zero or more occurrences of any character.
+// '?' matches any single character.
+// Ex: matchStr(".sec*", ".sec.1") == true
+// Ex: matchStr("crtbegin?.o", "crtbeginS.o") == true
+static bool matchStr(StringRef W, StringRef T) {
----------------
I don't think we need examples because this pattern matching is familiar.

  // Returns true if S matches T. S can contain DOS-style wildcard characters.
  // The asterisk ('*') matches one or more characacters, and the question
  // mark ('?') matches one character.

================
Comment at: test/ELF/wildcards.s:1
@@ +1,2 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
----------------
If you create a new file, please move the existing test for '*' in linkerscript-sections.s to this file.


http://reviews.llvm.org/D17290





More information about the llvm-commits mailing list