Skip to content

Commit 33e546e

Browse files
committed
Simplify the definition of PredefinedSugarTypeLoc
1 parent 6b8f27d commit 33e546e

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

clang/include/clang/AST/TypeLoc.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2767,10 +2767,6 @@ class DependentBitIntTypeLoc final
27672767
: public InheritingConcreteTypeLoc<TypeSpecTypeLoc, DependentBitIntTypeLoc,
27682768
DependentBitIntType> {};
27692769

2770-
class PredefinedSugarTypeLoc final
2771-
: public InheritingConcreteTypeLoc<TypeSpecTypeLoc, PredefinedSugarTypeLoc,
2772-
PredefinedSugarType> {};
2773-
27742770
class ObjCProtocolLoc {
27752771
ObjCProtocolDecl *Protocol = nullptr;
27762772
SourceLocation Loc = SourceLocation();
@@ -2787,6 +2783,15 @@ class ObjCProtocolLoc {
27872783
}
27882784
};
27892785

2786+
struct PredefinedSugarTypeLocInfo {}; // Nothing.
2787+
2788+
class PredefinedSugarTypeLoc final
2789+
: public ConcreteTypeLoc<UnqualTypeLoc, PredefinedSugarTypeLoc,
2790+
PredefinedSugarType, PredefinedSugarTypeLocInfo> {
2791+
public:
2792+
void initializeLocal(ASTContext &Context, SourceLocation loc) {}
2793+
};
2794+
27902795
} // namespace clang
27912796

27922797
#endif // LLVM_CLANG_AST_TYPELOC_H

clang/lib/Serialization/ASTReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7455,7 +7455,7 @@ void TypeLocReader::VisitDependentBitIntTypeLoc(
74557455
}
74567456

74577457
void TypeLocReader::VisitPredefinedSugarTypeLoc(PredefinedSugarTypeLoc TL) {
7458-
TL.setNameLoc(readSourceLocation());
7458+
// Nothing to do.
74597459
}
74607460

74617461
void ASTRecordReader::readTypeLoc(TypeLoc TL) {

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ void TypeLocWriter::VisitDependentBitIntTypeLoc(
704704

705705
void TypeLocWriter::VisitPredefinedSugarTypeLoc(
706706
clang::PredefinedSugarTypeLoc TL) {
707-
addSourceLocation(TL.getNameLoc());
707+
// Nothing to do.
708708
}
709709

710710
void ASTWriter::WriteTypeAbbrevs() {

0 commit comments

Comments
 (0)