aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clang/AST/Decl.h10
-rw-r--r--include/clang/AST/DeclBase.h21
-rw-r--r--include/clang/AST/Type.h2
3 files changed, 13 insertions, 20 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index bb75895df5..e00779844c 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -228,12 +228,6 @@ public:
"Enum truncated!");
}
- bool operator==(const LinkageInfo &Other) {
- return linkage_ == Other.linkage_ &&
- visibility_ == Other.visibility_ &&
- explicit_ == Other.explicit_;
- }
-
static LinkageInfo external() {
return LinkageInfo();
}
@@ -329,7 +323,7 @@ public:
/// \brief Clear the linkage cache in response to a change
/// to the declaration.
- void ClearLVCache();
+ void ClearLinkageCache();
/// \brief Looks through UsingDecls and ObjCCompatibleAliasDecls for
/// the underlying named decl.
@@ -3325,7 +3319,7 @@ void Redeclarable<decl_type>::setPreviousDeclaration(decl_type *PrevDecl) {
// First one will point to this one as latest.
First->RedeclLink = LatestDeclLink(static_cast<decl_type*>(this));
if (NamedDecl *ND = dyn_cast<NamedDecl>(static_cast<decl_type*>(this)))
- ND->ClearLVCache();
+ ND->ClearLinkageCache();
}
// Inline function definitions.
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index 823340aeaf..e3fa41ef31 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -241,7 +241,7 @@ private:
SourceLocation Loc;
/// DeclKind - This indicates which class this is.
- unsigned DeclKind : 6;
+ unsigned DeclKind : 8;
/// InvalidDecl - This indicates a semantic error occurred.
unsigned InvalidDecl : 1;
@@ -283,16 +283,15 @@ protected:
/// IdentifierNamespace - This specifies what IDNS_* namespace this lives in.
unsigned IdentifierNamespace : 12;
- /// These fields are only valid for NamedDecls subclasses.
+ /// \brief Whether the \c CachedLinkage field is active.
+ ///
+ /// This field is only valid for NamedDecls subclasses.
+ mutable unsigned HasCachedLinkage : 1;
+
+ /// \brief If \c HasCachedLinkage, the linkage of this declaration.
///
- /// \brief Nonzero if the cache (i.e. the bitfields here starting
- /// with 'Cache') is valid. If so, then this is a
- /// LangOptions::VisibilityMode+1.
- mutable unsigned CacheValidAndVisibility : 2;
- /// \brief the linkage of this declaration.
+ /// This field is only valid for NamedDecls subclasses.
mutable unsigned CachedLinkage : 2;
- /// \brief true if the visibility is explicit.
- mutable unsigned CachedVisibilityExplicit : 1;
friend class ASTDeclWriter;
friend class ASTDeclReader;
@@ -309,7 +308,7 @@ protected:
HasAttrs(false), Implicit(false), Used(false), Referenced(false),
Access(AS_none), FromASTFile(0), Hidden(0),
IdentifierNamespace(getIdentifierNamespaceForKind(DK)),
- CacheValidAndVisibility(0)
+ HasCachedLinkage(0)
{
if (StatisticsEnabled) add(DK);
}
@@ -319,7 +318,7 @@ protected:
HasAttrs(false), Implicit(false), Used(false), Referenced(false),
Access(AS_none), FromASTFile(0), Hidden(0),
IdentifierNamespace(getIdentifierNamespaceForKind(DK)),
- CacheValidAndVisibility(0)
+ HasCachedLinkage(0)
{
if (StatisticsEnabled) add(DK);
}
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index 7277f0fc68..cf3b565fc3 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -1786,7 +1786,7 @@ public:
std::pair<Linkage,Visibility> getLinkageAndVisibility() const;
/// \brief Note that the linkage is no longer known.
- void ClearLVCache();
+ void ClearLinkageCache();
const char *getTypeClassName() const;