]> granicus.if.org Git - clang/commit
msabi: Fix exponential mangling time for certain pathological inputs
authorNico Weber <nicolasweber@gmx.de>
Sat, 1 Jun 2019 10:12:07 +0000 (10:12 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sat, 1 Jun 2019 10:12:07 +0000 (10:12 +0000)
commit2c469237d842f397cb3d98ba8c243d9fbcd6d92a
tree177acf05a43fd7ddb79051e1119c206cf8b80a41
parent83b6db970ca7d26ee646a0d7a2087941280b936f
msabi: Fix exponential mangling time for certain pathological inputs

Template back references used to be recursively recomputed, add a
memoization cache to cut down on this.

Since there are now two different types of argument maps, rename the
existing TypeBackReferences to FunArgBackReferences, and rename
mangleArgumentType() to mangleFunctionArgumentType().

Fixes PR42091, the input there now takes 50ms instead of 7s to compile.

No intended behavior change.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362293 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/MicrosoftMangle.cpp
test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp