Skip to content

Commit 9d4e5be

Browse files
committed
Corrects usage of Abbrevs in ASTWriterDecl
1 parent 0a2f212 commit 9d4e5be

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/Serialization/ASTWriterDecl.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ void ASTDeclWriter::VisitObjCIvarDecl(ObjCIvarDecl *D) {
733733
!D->isReferenced() &&
734734
!D->isModulePrivate() &&
735735
!D->getBitWidth() &&
736+
!D->hasBoundsExpr() &&
736737
!D->hasExtInfo() &&
737738
D->getDeclName())
738739
AbbrevToUse = Writer.getDeclObjCIvarAbbrev();
@@ -867,6 +868,7 @@ void ASTDeclWriter::VisitFieldDecl(FieldDecl *D) {
867868
!D->isModulePrivate() &&
868869
!D->getBitWidth() &&
869870
!D->hasInClassInitializer() &&
871+
!D->hasBoundsExpr() &&
870872
!D->hasExtInfo() &&
871873
!ObjCIvarDecl::classofKind(D->getKind()) &&
872874
!ObjCAtDefsFieldDecl::classofKind(D->getKind()) &&
@@ -945,6 +947,7 @@ void ASTDeclWriter::VisitVarDecl(VarDecl *D) {
945947
!D->isModulePrivate() &&
946948
!needsAnonymousDeclarationNumber(D) &&
947949
D->getDeclName().getNameKind() == DeclarationName::Identifier &&
950+
!D->hasBoundsExpr() &&
948951
!D->hasExtInfo() &&
949952
D->getFirstDecl() == D->getMostRecentDecl() &&
950953
D->getInitStyle() == VarDecl::CInit &&
@@ -985,6 +988,7 @@ void ASTDeclWriter::VisitParmVarDecl(ParmVarDecl *D) {
985988
// know are true of all PARM_VAR_DECLs.
986989
if (D->getDeclContext() == D->getLexicalDeclContext() &&
987990
!D->hasAttrs() &&
991+
!D->hasBoundsExpr() &&
988992
!D->hasExtInfo() &&
989993
!D->isImplicit() &&
990994
!D->isUsed(false) &&
@@ -1240,6 +1244,7 @@ void ASTDeclWriter::VisitCXXMethodDecl(CXXMethodDecl *D) {
12401244
!D->hasAttrs() &&
12411245
!D->isTopLevelDeclInObjCContainer() &&
12421246
D->getDeclName().getNameKind() == DeclarationName::Identifier &&
1247+
!D->hasBoundsExpr() &&
12431248
!D->hasExtInfo() &&
12441249
!D->hasInheritedPrototype() &&
12451250
D->hasWrittenPrototype())
@@ -1719,7 +1724,7 @@ void ASTWriter::WriteDeclAbbrevs() {
17191724
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
17201725
// DeclaratorDecl
17211726
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // InnerStartLoc
1722-
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // hasBoundsExpr
1727+
Abv->Add(BitCodeAbbrevOp(0)); // hasBoundsExpr
17231728
Abv->Add(BitCodeAbbrevOp(0)); // hasExtInfo
17241729
// FieldDecl
17251730
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isMutable
@@ -1885,7 +1890,7 @@ void ASTWriter::WriteDeclAbbrevs() {
18851890
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
18861891
// DeclaratorDecl
18871892
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // InnerStartLoc
1888-
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // hasBoundsExpr
1893+
Abv->Add(BitCodeAbbrevOp(0)); // hasBoundsExpr
18891894
Abv->Add(BitCodeAbbrevOp(0)); // hasExtInfo
18901895
// VarDecl
18911896
Abv->Add(BitCodeAbbrevOp(0)); // StorageClass
@@ -1962,7 +1967,7 @@ void ASTWriter::WriteDeclAbbrevs() {
19621967
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
19631968
// DeclaratorDecl
19641969
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // InnerStartLoc
1965-
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // hasBoundsExpr
1970+
Abv->Add(BitCodeAbbrevOp(0)); // hasBoundsExpr
19661971
Abv->Add(BitCodeAbbrevOp(0)); // hasExtInfo
19671972
// VarDecl
19681973
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // StorageClass

0 commit comments

Comments
 (0)