[clang] 02cccdc - [AST] Remove a duplicated getDecl method in TemplateName, NFC.
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 11 02:59:41 PDT 2022
Author: Haojian Wu
Date: 2022-04-11T11:51:28+02:00
New Revision: 02cccdcab25eac735831b405b5ab712543b16950
URL: https://github.com/llvm/llvm-project/commit/02cccdcab25eac735831b405b5ab712543b16950
DIFF: https://github.com/llvm/llvm-project/commit/02cccdcab25eac735831b405b5ab712543b16950.diff
LOG: [AST] Remove a duplicated getDecl method in TemplateName, NFC.
There is a TemplateName::getTemplateDecl which does the same work.
Added:
Modified:
clang/include/clang/AST/TemplateName.h
clang/lib/AST/TemplateName.cpp
clang/tools/libclang/CIndex.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/AST/TemplateName.h b/clang/include/clang/AST/TemplateName.h
index 44080a7f56d42..26c64d0e277ff 100644
--- a/clang/include/clang/AST/TemplateName.h
+++ b/clang/include/clang/AST/TemplateName.h
@@ -415,10 +415,6 @@ class QualifiedTemplateName : public llvm::FoldingSetNode {
/// keyword.
bool hasTemplateKeyword() const { return Qualifier.getInt(); }
- /// The template declaration that this qualified name refers
- /// to.
- TemplateDecl *getDecl() const { return Template; }
-
/// The template declaration to which this qualified name
/// refers.
TemplateDecl *getTemplateDecl() const { return Template; }
diff --git a/clang/lib/AST/TemplateName.cpp b/clang/lib/AST/TemplateName.cpp
index 05d7d58b71c4d..a6d8a7fe7b3dd 100644
--- a/clang/lib/AST/TemplateName.cpp
+++ b/clang/lib/AST/TemplateName.cpp
@@ -243,7 +243,7 @@ void TemplateName::print(raw_ostream &OS, const PrintingPolicy &Policy,
QTN->getQualifier()->print(OS, Policy);
if (QTN->hasTemplateKeyword())
OS << "template ";
- OS << *QTN->getDecl();
+ OS << *QTN->getTemplateDecl();
} else if (DependentTemplateName *DTN = getAsDependentTemplateName()) {
if (Qual == Qualified::AsWritten && DTN->getQualifier())
DTN->getQualifier()->print(OS, Policy);
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 011d9f2fd7280..0c7406a9002b9 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -1462,7 +1462,7 @@ bool CursorVisitor::VisitTemplateName(TemplateName Name, SourceLocation Loc) {
case TemplateName::QualifiedTemplate:
// FIXME: Visit nested-name-specifier.
return Visit(MakeCursorTemplateRef(
- Name.getAsQualifiedTemplateName()->getDecl(), Loc, TU));
+ Name.getAsQualifiedTemplateName()->getTemplateDecl(), Loc, TU));
case TemplateName::SubstTemplateTemplateParm:
return Visit(MakeCursorTemplateRef(
More information about the cfe-commits
mailing list