Avoid O(n*m) complexity in StringRef::find_first(_not)_of(StringRef).
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 23 Aug 2010 18:16:08 +0000 (18:16 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 23 Aug 2010 18:16:08 +0000 (18:16 +0000)
commit250eb005d91e80b05a61345394bae9e9528151ac
treec58d7c38b1b4ffebf842dac455d0ccd72fc251e0
parent0e2c359a3e57e934d93298f1c666241ed0d481ee
Avoid O(n*m) complexity in StringRef::find_first(_not)_of(StringRef).

- Cache used characters in a bitset to reduce memory overhead to just 32 bytes.
- On my core2 this code is faster except when the checked string was very short
  (smaller than the list of delimiters).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111817 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/StringRef.h
lib/Support/StringRef.cpp