]> granicus.if.org Git - clang/commit
MS ABI: Avoid hashing back reference keys in mangler
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 25 Sep 2014 19:43:56 +0000 (19:43 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 25 Sep 2014 19:43:56 +0000 (19:43 +0000)
commitaef0810b014be069c4315b97cfb3dfaa593e3e9f
treee11a7f7e9cdd1874978e73f9e33cec478ca161d0
parent702863c43da79c158db2162a9ba5901797050aea
MS ABI: Avoid hashing back reference keys in mangler

This patch replaces the back reference StringMap from the MS mangler
with a SmallVector of strings. My previous patches reduced the number of
hashes involved in back reference lookups, this one removes them
completely. The back reference map contains at most 10 entries, which
are likely to be of varying sizes and different initial subsequences,
and which can easily became huge (due to templates and namespaces).

The solution presented is the simplest possible one. Nevertheless, it's
enough to reduce compilation times for a particular test case from 11.1s
to 9s, versus 8.58s for the Itanium ABI. Possible further improvements
include using a sorted vector (carefully to not introduce an extra
comparison), storing the string contents in a common arena, and/or keep
the string storage in the context for reuse.

Patch by Agustín Bergé.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218461 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/MicrosoftMangle.cpp