We stack-allocate 512 of these entries for a temporary cache, so the entry size matters a great deal. Shrink it from 3 words to 2 by storing treatAsIdentifier in the low bit of the node pointer.
rdar://149685318
The deepHash() function gets called repeatedly as we descend the
node tree, which results in O(n^2) behaviour because we're traversing
entire node subtree from each node we try substitution in, in order
to calculate the hash.
Fix by adding a hash table for hashes, so that we can look up hashes
we've already computed.
This appears to yield a 26.8% saving in local tests.
rdar://125739630
Since libDemangling is included in the Swift standard library,
ODR violations can occur on platforms that allow statically
linking stdlib if Swift code is linked with other compiler
libraries that also transitively pull in libDemangling, and if
the stdlib version and compiler version do not match exactly
(even down to commit drift between releases). This lets the
runtime conditionally segregate its copies of the libDemangling
symbols from those in the compiler using an inline namespace
without affecting usage throughout source.
Extract common code from the old and new remangler into a common base class.
This lets the old remangler benefit from the changes I did recently in the new remangler.