This patch changes the demangler so that it represents substitutions/templates more linearly. Previously, substitions were represented by a vector<vector<Node*>> and template parameter substitutions by a vector<vector<vector<Node*>>>! I wrote a comment in SubTable describing how this is done.
This patch gives a 20%-25% time reduction to demangle the symbols in LLVM, a 25% reduction in code size for the demangler on my machine, and makes the demangler a lot easier to read, IMO.
Thanks for taking a look!
Erik
This seems like a facility that should/could be unit tested (in C++).
I realize there's no precedent for that for the demangler. Perhaps this file could be #included by a test file:
Thoughts?