Skip to content

Commit cc13239

Browse files
committed
[clang] NFC: rename TagType::getOriginalDecl back to getDecl
This rename was made as part of #147835 in order to ease rebasing the PR, and give a nice window for other patches to get rebased as well. This has been a while already, so lets go ahead and rename it back.
1 parent 7a11eb9 commit cc13239

File tree

135 files changed

+415
-510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+415
-510
lines changed

clang-tools-extra/clang-tidy/bugprone/InvalidEnumDefaultInitializationCheck.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ class FindEnumMember : public TypeVisitor<FindEnumMember, bool> {
6969
return Visit(T->getElementType().getTypePtr());
7070
}
7171
bool VisitEnumType(const EnumType *T) {
72-
if (isCompleteAndHasNoZeroValue(T->getOriginalDecl())) {
72+
if (isCompleteAndHasNoZeroValue(T->getDecl())) {
7373
FoundEnum = T;
7474
return true;
7575
}
7676
return false;
7777
}
7878
bool VisitRecordType(const RecordType *T) {
79-
const RecordDecl *RD = T->getOriginalDecl()->getDefinition();
79+
const RecordDecl *RD = T->getDecl()->getDefinition();
8080
if (!RD || RD->isUnion())
8181
return false;
8282
auto VisitField = [this](const FieldDecl *F) {
@@ -139,7 +139,7 @@ void InvalidEnumDefaultInitializationCheck::check(
139139
if (!Finder.Visit(InitList->getArrayFiller()->getType().getTypePtr()))
140140
return;
141141
InitExpr = InitList;
142-
Enum = Finder.FoundEnum->getOriginalDecl();
142+
Enum = Finder.FoundEnum->getDecl();
143143
}
144144

145145
if (!InitExpr || !Enum)

clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ struct InitializerInsertion {
190190
// Convenience utility to get a RecordDecl from a QualType.
191191
const RecordDecl *getCanonicalRecordDecl(const QualType &Type) {
192192
if (const auto *RT = Type->getAsCanonical<RecordType>())
193-
return RT->getOriginalDecl();
193+
return RT->getDecl();
194194
return nullptr;
195195
}
196196

clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static bool isStdInitializerList(QualType Type) {
7272
}
7373
if (const auto *RT = Type->getAs<RecordType>()) {
7474
if (const auto *Specialization =
75-
dyn_cast<ClassTemplateSpecializationDecl>(RT->getOriginalDecl()))
75+
dyn_cast<ClassTemplateSpecializationDecl>(RT->getDecl()))
7676
return declIsStdInitializerList(Specialization->getSpecializedTemplate());
7777
}
7878
return false;

clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void UnusedUsingDeclsCheck::check(const MatchFinder::MatchResult &Result) {
132132
}
133133
if (const auto *ECD = dyn_cast<EnumConstantDecl>(Used)) {
134134
if (const auto *ET = ECD->getType()->getAsCanonical<EnumType>())
135-
removeFromFoundDecls(ET->getOriginalDecl());
135+
removeFromFoundDecls(ET->getDecl());
136136
}
137137
};
138138
// We rely on the fact that the clang AST is walked in order, usages are only

clang-tools-extra/clang-tidy/modernize/UseScopedLockCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static bool isLockGuardDecl(const NamedDecl *Decl) {
2929

3030
static bool isLockGuard(const QualType &Type) {
3131
if (const auto *Record = Type->getAsCanonical<RecordType>())
32-
if (const RecordDecl *Decl = Record->getOriginalDecl())
32+
if (const RecordDecl *Decl = Record->getDecl())
3333
return isLockGuardDecl(Decl);
3434

3535
if (const auto *TemplateSpecType = Type->getAs<TemplateSpecializationType>())

clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct UnqualNameVisitor : public RecursiveASTVisitor<UnqualNameVisitor> {
7777
if (T->getKeyword() != ElaboratedTypeKeyword::None ||
7878
TTL.getQualifierLoc())
7979
break;
80-
if (visitUnqualName(T->getOriginalDecl()->getName()))
80+
if (visitUnqualName(T->getDecl()->getName()))
8181
return false;
8282
break;
8383
}

clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,10 @@ static bool areTypesCompatible(QualType ArgType, QualType ParamType,
413413

414414
// Arithmetic types are interconvertible, except scoped enums.
415415
if (ParamType->isArithmeticType() && ArgType->isArithmeticType()) {
416-
if ((ParamType->isEnumeralType() && ParamType->castAsCanonical<EnumType>()
417-
->getOriginalDecl()
418-
->isScoped()) ||
416+
if ((ParamType->isEnumeralType() &&
417+
ParamType->castAsCanonical<EnumType>()->getDecl()->isScoped()) ||
419418
(ArgType->isEnumeralType() &&
420-
ArgType->castAsCanonical<EnumType>()->getOriginalDecl()->isScoped()))
419+
ArgType->castAsCanonical<EnumType>()->getDecl()->isScoped()))
421420
return false;
422421

423422
return true;

clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ class RenamerClangTidyVisitor
331331
}
332332

333333
bool VisitTagTypeLoc(const TagTypeLoc &Loc) {
334-
Check->addUsage(Loc.getOriginalDecl(), Loc.getNameLoc(), SM);
334+
Check->addUsage(Loc.getDecl(), Loc.getNameLoc(), SM);
335335
return true;
336336
}
337337

clang-tools-extra/clangd/DumpAST.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ class DumpVisitor : public RecursiveASTVisitor<DumpVisitor> {
261261
return TL.getType().getLocalQualifiers().getAsString(
262262
Ctx.getPrintingPolicy());
263263
if (const auto *TT = dyn_cast<TagType>(TL.getTypePtr()))
264-
return getDetail(TT->getOriginalDecl());
264+
return getDetail(TT->getDecl());
265265
if (const auto *DT = dyn_cast<DeducedType>(TL.getTypePtr()))
266266
if (DT->isDeduced())
267267
return DT->getDeducedType().getAsString(Ctx.getPrintingPolicy());

clang-tools-extra/clangd/FindTarget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ struct TargetFinder {
366366
Visitor(TargetFinder &Outer, RelSet Flags) : Outer(Outer), Flags(Flags) {}
367367

368368
void VisitTagType(const TagType *TT) {
369-
Outer.add(cast<TagType>(TT)->getOriginalDecl(), Flags);
369+
Outer.add(cast<TagType>(TT)->getDecl(), Flags);
370370
}
371371

372372
void VisitUsingType(const UsingType *ET) {
@@ -861,7 +861,7 @@ refInTypeLoc(TypeLoc L, const HeuristicResolver *Resolver) {
861861
Refs.push_back(ReferenceLoc{L.getQualifierLoc(),
862862
L.getNameLoc(),
863863
/*IsDecl=*/false,
864-
{L.getOriginalDecl()}});
864+
{L.getDecl()}});
865865
}
866866

867867
void VisitTemplateTypeParmTypeLoc(TemplateTypeParmTypeLoc L) {

0 commit comments

Comments
 (0)