diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-04 03:27:32 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-04 03:27:32 +0000 |
commit | 6a7664c4a8b378da5a7f58d940d39b76fb0d6673 (patch) | |
tree | 80bedb6fa1b0316be820df0d2e760f39faa2a120 /lib/AST/Decl.cpp | |
parent | 4a3c6c6daebce44416a63bb19ad1ab7fe0d16354 (diff) |
Avoid computing the linkage instead of avoiding caching it.
This mostly reverts 178733, but keeps the tests.
I don't claim to understand how hidden sub modules work or when we need to see
them (is that documented?), but this has the same semantics and avoids adding
hasExternalLinkageUncached which has the same foot gun potential as the old
hasExternalLinkage.
Last but not least, not computing linkage when it is not needed is more
efficient.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178739 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index bf807aeb1d..9505d299ab 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -866,10 +866,6 @@ bool NamedDecl::isLinkageValid() const { Linkage(CachedLinkage); } -bool NamedDecl::hasExternalLinkageUncached() const { - return getLVForDecl(this, LVForExplicitValue).getLinkage() == ExternalLinkage; -} - Linkage NamedDecl::getLinkage() const { if (HasCachedLinkage) return Linkage(CachedLinkage); |