[clang] 70a4494 - [clang] Remove unused ASTContext::getInstantiatedFromStaticDataMember (NFC) (#233019)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Oct 18 01:06:21 PDT 2026
Author: Kazu Hirata
Date: 2026-10-18T01:06:16-07:00
New Revision: 70a4494e073f57eebb77931a5a2e59f6b5e9e13a
URL: https://github.com/llvm/llvm-project/commit/70a4494e073f57eebb77931a5a2e59f6b5e9e13a
DIFF: https://github.com/llvm/llvm-project/commit/70a4494e073f57eebb77931a5a2e59f6b5e9e13a.diff
LOG: [clang] Remove unused ASTContext::getInstantiatedFromStaticDataMember (NFC) (#233019)
The last caller was removed on August 6, 2013 in commit
39a1e507ff0bef4bd6b2fdbab4e38583d2679617.
This patch also removes the stale FIXME and the commented-out call in
VarDecl::getMemberSpecializationInfo that referred to it.
Assisted-by: Antigravity
Added:
Modified:
clang/include/clang/AST/ASTContext.h
clang/lib/AST/ASTContext.cpp
clang/lib/AST/Decl.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h
index 04cc2da25cecbb..467f0d7bd0af9f 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -1215,13 +1215,6 @@ class ASTContext : public RefCountedBase<ASTContext> {
void addExplicitInstantiationDecl(const NamedDecl *Spec,
ExplicitInstantiationDecl *EID);
- /// If this variable is an instantiated static data member of a
- /// class template specialization, returns the templated static data member
- /// from which it was instantiated.
- // FIXME: Remove ?
- MemberSpecializationInfo *getInstantiatedFromStaticDataMember(
- const VarDecl *Var);
-
/// Note that the static data member \p Inst is an instantiation of
/// the static data member template \p Tmpl of a class template.
void setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl,
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index ed22919b7a70bb..d549236086e252 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -1590,14 +1590,6 @@ void ASTContext::addExplicitInstantiationDecl(const NamedDecl *Spec,
EID);
}
-// FIXME: Remove ?
-MemberSpecializationInfo *
-ASTContext::getInstantiatedFromStaticDataMember(const VarDecl *Var) {
- assert(Var->isStaticDataMember() && "Not a static data member");
- return getTemplateOrSpecializationInfo(Var)
- .dyn_cast<MemberSpecializationInfo *>();
-}
-
ASTContext::TemplateOrSpecializationInfo
ASTContext::getTemplateOrSpecializationInfo(const VarDecl *Var) {
llvm::DenseMap<const VarDecl *, TemplateOrSpecializationInfo>::iterator Pos =
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 4d8af9232500aa..ddf71ad1199af6 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -2872,8 +2872,6 @@ CharUnits VarDecl::getFlexibleArrayInitChars(const ASTContext &Ctx) const {
MemberSpecializationInfo *VarDecl::getMemberSpecializationInfo() const {
if (isStaticDataMember())
- // FIXME: Remove ?
- // return getASTContext().getInstantiatedFromStaticDataMember(this);
return dyn_cast_if_present<MemberSpecializationInfo *>(
getASTContext().getTemplateOrSpecializationInfo(this));
return nullptr;
More information about the cfe-commits
mailing list