diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-12-06 18:36:25 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-12-06 18:36:25 +0000 |
commit | 381d34e0b205ca27bcc7e7c1652561941c437965 (patch) | |
tree | bcc773b9b2992ca9f0cc00534faf29b0e9464a8a /lib/CodeGen/Mangle.cpp | |
parent | 40c2913cef2c211f1fe720ffef83fdb3e4d0fabf (diff) |
Re-implement caching for the linkage calculation of declarations.
My previous attempt at solving the compile-time problem with many
redeclarations of the same entity cached both linkage and visibility,
while this patch only tackles linkage. There are several reasons for
this difference:
- Linkage is a language concept, and is evaluated many times during
semantic analysis and codegen, while visibility is only a
code-generation concept that is evaluated only once per (unique)
declaration. Hence, we *must* optimize linkage calculations but
don't need to optimize visibility computation.
- Once we know the linkage of a declaration, subsequent
redeclarations can't change that linkage. Hence, cache
invalidation is far simpler than for visibility, where a later
redeclaration can completely change the visibility.
- We have 3 spare bits in Decl to store the linkage cache, so the
cache doesn't increase the size of declarations. With the
visibility+linkage cache, NamedDecl got larger.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121023 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
0 files changed, 0 insertions, 0 deletions