Skip to content

Commit 1af2d3f

Browse files
committed
[FOLD] cleanups
1 parent c787a57 commit 1af2d3f

File tree

5 files changed

+2
-115
lines changed

5 files changed

+2
-115
lines changed

clang/include/clang/AST/ExprCXX.h

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3807,25 +3807,8 @@ class CXXDependentScopeMemberExpr final
38073807
return getQualifierLoc().getNestedNameSpecifier();
38083808
}
38093809

3810-
#if 0
3811-
/// Retrieve the first part of the nested-name-specifier that was
3812-
/// found in the scope of the member access expression when the member access
3813-
/// was initially parsed.
3814-
///
3815-
/// This function only returns a useful result when member access expression
3816-
/// uses a qualified member name, e.g., "x.Base::f". Here, the declaration
3817-
/// returned by this function describes what was found by unqualified name
3818-
/// lookup for the identifier "Base" within the scope of the member access
3819-
/// expression itself. At template instantiation time, this information is
3820-
/// combined with the results of name lookup into the type of the object
3821-
/// expression itself (the class type of x).
3822-
NamedDecl *getFirstQualifierFoundInScope() const {
3823-
if (!hasFirstQualifierFoundInScope())
3824-
return nullptr;
3825-
return *getTrailingObjects<NamedDecl *>();
3826-
}
3827-
#endif
3828-
3810+
/// Retrieve the declarations found by unqualified lookup for the first
3811+
/// component name of the nested-name-specifier, if any.
38293812
ArrayRef<DeclAccessPair> unqualified_lookups() const {
38303813
if (!getNumUnqualifiedLookups())
38313814
return std::nullopt;

clang/include/clang/AST/Stmt.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,12 +1030,6 @@ class alignas(void *) Stmt {
10301030
LLVM_PREFERRED_TYPE(bool)
10311031
unsigned HasTemplateKWAndArgsInfo : 1;
10321032

1033-
#if 0
1034-
/// See getFirstQualifierFoundInScope() and the comment listing
1035-
/// the trailing objects.
1036-
LLVM_PREFERRED_TYPE(bool)
1037-
unsigned HasFirstQualifierFoundInScope : 1;
1038-
#endif
10391033
/// Number of declarations found by unqualified lookup for the
10401034
/// first component name of the nested-name-specifier.
10411035
unsigned NumUnqualifiedLookups;

clang/lib/Sema/TreeTransform.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14628,15 +14628,6 @@ TreeTransform<Derived>::TransformCXXDependentScopeMemberExpr(
1462814628
ObjectType = BaseType->castAs<PointerType>()->getPointeeType();
1462914629
}
1463014630

14631-
#if 0
14632-
// Transform the first part of the nested-name-specifier that qualifies
14633-
// the member name.
14634-
NamedDecl *FirstQualifierInScope
14635-
= getDerived().TransformFirstQualifierInScope(
14636-
E->getFirstQualifierFoundInScope(),
14637-
E->getQualifierLoc().getBeginLoc());
14638-
#endif
14639-
1464014631
UnresolvedSet<4> UnqualifiedLookups;
1464114632
for (auto D : E->unqualified_lookups()) {
1464214633
if (NamedDecl *InstD = getDerived().TransformFirstQualifierInScope(

clang/lib/Serialization/ASTReaderStmt.cpp

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,52 +2014,12 @@ void ASTStmtReader::VisitCXXDependentScopeMemberExpr(
20142014
auto AS = (AccessSpecifier)Record.readInt();
20152015
E->getTrailingObjects<DeclAccessPair>()[I] =
20162016
DeclAccessPair::make(FoundD, AS);
2017-
;
20182017
}
20192018

20202019
if (HasTemplateInfo)
20212020
ReadTemplateKWAndArgsInfo(
20222021
*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
20232022
E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
2024-
2025-
#if 0
2026-
unsigned NumTemplateArgs = Record.readInt();
2027-
CurrentUnpackingBits.emplace(Record.readInt());
2028-
bool HasTemplateKWAndArgsInfo = CurrentUnpackingBits->getNextBit();
2029-
bool HasFirstQualifierFoundInScope = CurrentUnpackingBits->getNextBit();
2030-
2031-
assert((HasTemplateKWAndArgsInfo == E->hasTemplateKWAndArgsInfo()) &&
2032-
"Wrong HasTemplateKWAndArgsInfo!");
2033-
assert(
2034-
(HasFirstQualifierFoundInScope == E->hasFirstQualifierFoundInScope()) &&
2035-
"Wrong HasFirstQualifierFoundInScope!");
2036-
2037-
if (HasTemplateKWAndArgsInfo)
2038-
ReadTemplateKWAndArgsInfo(
2039-
*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
2040-
E->getTrailingObjects<TemplateArgumentLoc>(), NumTemplateArgs);
2041-
2042-
assert((NumTemplateArgs == E->getNumTemplateArgs()) &&
2043-
"Wrong NumTemplateArgs!");
2044-
2045-
E->CXXDependentScopeMemberExprBits.IsArrow =
2046-
CurrentUnpackingBits->getNextBit();
2047-
2048-
E->BaseType = Record.readType();
2049-
E->QualifierLoc = Record.readNestedNameSpecifierLoc();
2050-
// not ImplicitAccess
2051-
if (CurrentUnpackingBits->getNextBit())
2052-
E->Base = Record.readSubExpr();
2053-
else
2054-
E->Base = nullptr;
2055-
2056-
E->CXXDependentScopeMemberExprBits.OperatorLoc = readSourceLocation();
2057-
2058-
if (HasFirstQualifierFoundInScope)
2059-
*E->getTrailingObjects<NamedDecl *>() = readDeclAs<NamedDecl>();
2060-
2061-
E->MemberNameInfo = Record.readDeclarationNameInfo();
2062-
#endif
20632023
}
20642024

20652025
void
@@ -4096,16 +4056,6 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
40964056
break;
40974057

40984058
case EXPR_CXX_DEPENDENT_SCOPE_MEMBER: {
4099-
4100-
#if 0
4101-
unsigned NumTemplateArgs = Record[ASTStmtReader::NumExprFields];
4102-
BitsUnpacker DependentScopeMemberBits(
4103-
Record[ASTStmtReader::NumExprFields + 1]);
4104-
bool HasTemplateKWAndArgsInfo = DependentScopeMemberBits.getNextBit();
4105-
4106-
bool HasFirstQualifierFoundInScope =
4107-
DependentScopeMemberBits.getNextBit();
4108-
#endif
41094059
BitsUnpacker DependentScopeMemberBits(
41104060
Record[ASTStmtReader::NumExprFields]);
41114061
bool HasQualifier = DependentScopeMemberBits.getNextBit();

clang/lib/Serialization/ASTWriterStmt.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,37 +2012,6 @@ void ASTStmtWriter::VisitCXXDependentScopeMemberExpr(
20122012
AddTemplateKWAndArgsInfo(*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>(),
20132013
E->getTrailingObjects<TemplateArgumentLoc>());
20142014

2015-
#if 0
2016-
// Don't emit anything here (or if you do you will have to update
2017-
// the corresponding deserialization function).
2018-
Record.push_back(E->getNumTemplateArgs());
2019-
CurrentPackingBits.updateBits();
2020-
CurrentPackingBits.addBit(E->hasTemplateKWAndArgsInfo());
2021-
CurrentPackingBits.addBit(E->hasFirstQualifierFoundInScope());
2022-
2023-
if (E->hasTemplateKWAndArgsInfo()) {
2024-
const ASTTemplateKWAndArgsInfo &ArgInfo =
2025-
*E->getTrailingObjects<ASTTemplateKWAndArgsInfo>();
2026-
AddTemplateKWAndArgsInfo(ArgInfo,
2027-
E->getTrailingObjects<TemplateArgumentLoc>());
2028-
}
2029-
2030-
CurrentPackingBits.addBit(E->isArrow());
2031-
2032-
Record.AddTypeRef(E->getBaseType());
2033-
Record.AddNestedNameSpecifierLoc(E->getQualifierLoc());
2034-
CurrentPackingBits.addBit(!E->isImplicitAccess());
2035-
if (!E->isImplicitAccess())
2036-
Record.AddStmt(E->getBase());
2037-
2038-
Record.AddSourceLocation(E->getOperatorLoc());
2039-
2040-
if (E->hasFirstQualifierFoundInScope())
2041-
Record.AddDeclRef(E->getFirstQualifierFoundInScope());
2042-
2043-
Record.AddDeclarationNameInfo(E->MemberNameInfo);
2044-
#endif
2045-
20462015
Code = serialization::EXPR_CXX_DEPENDENT_SCOPE_MEMBER;
20472016
}
20482017

0 commit comments

Comments
 (0)