emit the LLVM intrinsic name -> intrinsic number mapping table with

StringMatcher instead of a linear sequence of memcmps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113145 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2010-09-06 03:58:45 +00:00
parent 09981982f1
commit cc67c75b67
2 changed files with 37 additions and 28 deletions

View File

@@ -78,9 +78,9 @@ EmitStringMatcherForChar(const std::vector<const StringPair*> &Matches,
<< Matches[0]->first[CharNo] << "')\n";
OS << Indent << " break;\n";
} else {
// Do the comparison with if (Str.substr(1,3) != "foo").
// Do the comparison with if (Str.substr(1, 3) != "foo").
// FIXME: Need to escape general strings.
OS << Indent << "if (" << StrVariableName << ".substr(" << CharNo << ","
OS << Indent << "if (" << StrVariableName << ".substr(" << CharNo << ", "
<< NumChars << ") != \"";
OS << Matches[0]->first.substr(CharNo, NumChars) << "\")\n";
OS << Indent << " break;\n";