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