[llvm-commits] [llvm] r113140 - /llvm/trunk/utils/TableGen/StringMatcher.cpp

Chris Lattner sabre at nondot.org
Sun Sep 5 20:11:10 PDT 2010


Author: lattner
Date: Sun Sep  5 22:11:10 2010
New Revision: 113140

URL: http://llvm.org/viewvc/llvm-project?rev=113140&view=rev
Log:
fix a critical bug where the generated table would say
"1 strings to match" in a comment, which isn't gramatic.

Modified:
    llvm/trunk/utils/TableGen/StringMatcher.cpp

Modified: llvm/trunk/utils/TableGen/StringMatcher.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/StringMatcher.cpp?rev=113140&r1=113139&r2=113140&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/StringMatcher.cpp (original)
+++ llvm/trunk/utils/TableGen/StringMatcher.cpp Sun Sep  5 22:11:10 2010
@@ -98,7 +98,9 @@
        MatchesByLetter.begin(), E = MatchesByLetter.end(); LI != E; ++LI) {
     // TODO: escape hard stuff (like \n) if we ever care about it.
     OS << Indent << "case '" << LI->first << "':\t // "
-    << LI->second.size() << " strings to match.\n";
+       << LI->second.size() << " string";
+    if (LI->second.size() != 1) OS << 's';
+    OS << " to match.\n";
     if (EmitStringMatcherForChar(LI->second, CharNo+1, IndentCount+1))
       OS << Indent << "  break;\n";
   }





More information about the llvm-commits mailing list