[MS Demangler] Properly handle backreferencing of special names.
authorZachary Turner <zturner@google.com>
Wed, 8 Aug 2018 00:43:31 +0000 (00:43 +0000)
committerZachary Turner <zturner@google.com>
Wed, 8 Aug 2018 00:43:31 +0000 (00:43 +0000)
commit58d29cf590fa7d404f38ecd874f3342d13abbed4
tree79641bbc156816c919797b28b3498a017d671222
parent2e34bbd8e842c6c0fb5adaaafcbf90d971d3c114
[MS Demangler] Properly handle backreferencing of special names.

Function template names are not stored in the backref table,
but non-template function names are.  The general pattern seems
to be that when you are demangling a symbol name, if the name
starts with '?' it does not go into the backreference table,
otherwise it does.  Note that this even handles the general case
of operator names (template or otherwise) not going into the
back-reference table, anonymous namespaces not going into the
backreference table, etc.

It's important that we apply this check *only* for the
unqualified portion of a name, and only for symbol names.
For example, this does not apply to type names (such as class
templates) and we need to make sure that these still do go
into the backref table.

Differential Revision: https://reviews.llvm.org/D50394

llvm-svn: 339211
llvm/lib/Demangle/MicrosoftDemangle.cpp
llvm/test/Demangle/ms-back-references.test