Skip to content

Commit ec35e55

Browse files
AaronBallmantomtor
authored andcommitted
Fix build after removing delayed typo expression
This addresses issues found by: https://lab.llvm.org/buildbot/#/builders/64/builds/4220 https://lab.llvm.org/buildbot/#/builders/51/builds/17890
1 parent 894bc29 commit ec35e55

File tree

3 files changed

+0
-94
lines changed

3 files changed

+0
-94
lines changed

clang/lib/Parse/ParseExpr.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, prec::Level MinPrec) {
513513
}
514514
}
515515

516-
ExprResult OrigLHS = LHS;
517516
if (!LHS.isInvalid()) {
518517
// Combine the LHS and RHS into the LHS (e.g. build AST).
519518
if (TernaryMiddle.isInvalid()) {

clang/lib/Sema/SemaExpr.cpp

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,42 +2446,6 @@ Sema::DecomposeUnqualifiedId(const UnqualifiedId &Id,
24462446
}
24472447
}
24482448

2449-
static void emitEmptyLookupTypoDiagnostic(const TypoCorrection &TC,
2450-
Sema &SemaRef, const CXXScopeSpec &SS,
2451-
DeclarationName Typo,
2452-
SourceRange TypoRange,
2453-
unsigned DiagnosticID,
2454-
unsigned DiagnosticSuggestID) {
2455-
DeclContext *Ctx =
2456-
SS.isEmpty() ? nullptr : SemaRef.computeDeclContext(SS, false);
2457-
if (!TC) {
2458-
// Emit a special diagnostic for failed member lookups.
2459-
// FIXME: computing the declaration context might fail here (?)
2460-
if (Ctx)
2461-
SemaRef.Diag(TypoRange.getBegin(), diag::err_no_member)
2462-
<< Typo << Ctx << TypoRange;
2463-
else
2464-
SemaRef.Diag(TypoRange.getBegin(), DiagnosticID) << Typo << TypoRange;
2465-
return;
2466-
}
2467-
2468-
std::string CorrectedStr = TC.getAsString(SemaRef.getLangOpts());
2469-
bool DroppedSpecifier =
2470-
TC.WillReplaceSpecifier() && Typo.getAsString() == CorrectedStr;
2471-
unsigned NoteID = TC.getCorrectionDeclAs<ImplicitParamDecl>()
2472-
? diag::note_implicit_param_decl
2473-
: diag::note_previous_decl;
2474-
if (!Ctx)
2475-
SemaRef.diagnoseTypo(
2476-
TC, SemaRef.PDiag(DiagnosticSuggestID) << Typo << TypoRange,
2477-
SemaRef.PDiag(NoteID));
2478-
else
2479-
SemaRef.diagnoseTypo(TC,
2480-
SemaRef.PDiag(diag::err_no_member_suggest)
2481-
<< Typo << Ctx << DroppedSpecifier << TypoRange,
2482-
SemaRef.PDiag(NoteID));
2483-
}
2484-
24852449
bool Sema::DiagnoseDependentMemberLookup(const LookupResult &R) {
24862450
// During a default argument instantiation the CurContext points
24872451
// to a CXXMethodDecl; but we can't apply a this-> fixit inside a
@@ -14922,18 +14886,6 @@ static void checkObjCPointerIntrospection(Sema &S, ExprResult &L, ExprResult &R,
1492214886
}
1492314887
}
1492414888

14925-
static NamedDecl *getDeclFromExpr(Expr *E) {
14926-
if (!E)
14927-
return nullptr;
14928-
if (auto *DRE = dyn_cast<DeclRefExpr>(E))
14929-
return DRE->getDecl();
14930-
if (auto *ME = dyn_cast<MemberExpr>(E))
14931-
return ME->getMemberDecl();
14932-
if (auto *IRE = dyn_cast<ObjCIvarRefExpr>(E))
14933-
return IRE->getDecl();
14934-
return nullptr;
14935-
}
14936-
1493714889
// This helper function promotes a binary operator's operands (which are of a
1493814890
// half vector type) to a vector of floats and then truncates the result to
1493914891
// a vector of either half or short.

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7647,51 +7647,6 @@ static void CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(
76477647
CurrentLSI->clearPotentialCaptures();
76487648
}
76497649

7650-
static ExprResult attemptRecovery(Sema &SemaRef,
7651-
const TypoCorrectionConsumer &Consumer,
7652-
const TypoCorrection &TC) {
7653-
LookupResult R(SemaRef, Consumer.getLookupResult().getLookupNameInfo(),
7654-
Consumer.getLookupResult().getLookupKind());
7655-
const CXXScopeSpec *SS = Consumer.getSS();
7656-
CXXScopeSpec NewSS;
7657-
7658-
// Use an approprate CXXScopeSpec for building the expr.
7659-
if (auto *NNS = TC.getCorrectionSpecifier())
7660-
NewSS.MakeTrivial(SemaRef.Context, NNS, TC.getCorrectionRange());
7661-
else if (SS && !TC.WillReplaceSpecifier())
7662-
NewSS = *SS;
7663-
7664-
if (auto *ND = TC.getFoundDecl()) {
7665-
R.setLookupName(ND->getDeclName());
7666-
R.addDecl(ND);
7667-
if (ND->isCXXClassMember()) {
7668-
// Figure out the correct naming class to add to the LookupResult.
7669-
CXXRecordDecl *Record = nullptr;
7670-
if (auto *NNS = TC.getCorrectionSpecifier())
7671-
Record = NNS->getAsType()->getAsCXXRecordDecl();
7672-
if (!Record)
7673-
Record =
7674-
dyn_cast<CXXRecordDecl>(ND->getDeclContext()->getRedeclContext());
7675-
if (Record)
7676-
R.setNamingClass(Record);
7677-
7678-
// Detect and handle the case where the decl might be an implicit
7679-
// member.
7680-
if (SemaRef.isPotentialImplicitMemberAccess(
7681-
NewSS, R, Consumer.isAddressOfOperand()))
7682-
return SemaRef.BuildPossibleImplicitMemberExpr(
7683-
NewSS, /*TemplateKWLoc*/ SourceLocation(), R,
7684-
/*TemplateArgs*/ nullptr, /*S*/ nullptr);
7685-
} else if (auto *Ivar = dyn_cast<ObjCIvarDecl>(ND)) {
7686-
return SemaRef.ObjC().LookupInObjCMethod(R, Consumer.getScope(),
7687-
Ivar->getIdentifier());
7688-
}
7689-
}
7690-
7691-
return SemaRef.BuildDeclarationNameExpr(NewSS, R, /*NeedsADL*/ false,
7692-
/*AcceptInvalidDecl*/ true);
7693-
}
7694-
76957650
ExprResult Sema::ActOnFinishFullExpr(Expr *FE, SourceLocation CC,
76967651
bool DiscardedValue, bool IsConstexpr,
76977652
bool IsTemplateArgument) {

0 commit comments

Comments
 (0)