aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/AST/Decl.h11
-rw-r--r--include/clang/AST/DeclBase.h21
-rw-r--r--include/clang/AST/Type.h2
3 files changed, 14 insertions, 20 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index 12b6c4a980..da12a5f591 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -109,6 +109,7 @@ class NamedDecl : public Decl {
private:
NamedDecl *getUnderlyingDeclImpl();
+ void verifyLinkage() const;
protected:
NamedDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N)
@@ -228,12 +229,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 +324,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.
@@ -3337,7 +3332,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 c91284d54a..115edf6d92 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -242,7 +242,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;
@@ -284,16 +284,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;
@@ -310,7 +309,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);
}
@@ -320,7 +319,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 98e2b6fb46..2f1b48eb0f 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -1781,7 +1781,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;