diff options
author | Stephen Kelly <steveire@gmail.com> | 2018-08-09 21:08:08 +0000 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2018-08-09 21:08:08 +0000 |
commit | f2ceec4811c3587056344dd5ef8d819261e256ad (patch) | |
tree | e3d713a6806e8f9b334df4a7083d82dfc5c06d79 /clang/lib/AST/ExprConstant.cpp | |
parent | a6e4358f071e18aa969c0ae820745510b3581aff (diff) | |
download | bcm5719-llvm-f2ceec4811c3587056344dd5ef8d819261e256ad.tar.gz bcm5719-llvm-f2ceec4811c3587056344dd5ef8d819261e256ad.zip |
Port getLocStart -> getBeginLoc
Reviewers: teemperor!
Subscribers: jholewinski, whisperity, jfb, cfe-commits
Differential Revision: https://reviews.llvm.org/D50350
llvm-svn: 339385
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 0ce962e4194..f48d0878d6b 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -832,7 +832,7 @@ namespace { bool nextStep(const Stmt *S) { if (!StepsLeft) { - FFDiag(S->getLocStart(), diag::note_constexpr_step_limit_exceeded); + FFDiag(S->getBeginLoc(), diag::note_constexpr_step_limit_exceeded); return false; } --StepsLeft; @@ -2554,8 +2554,8 @@ static bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, if (Info.checkingPotentialConstantExpression()) return false; // FIXME: implement capture evaluation during constant expr evaluation. - Info.FFDiag(E->getLocStart(), - diag::note_unimplemented_constexpr_lambda_feature_ast) + Info.FFDiag(E->getBeginLoc(), + diag::note_unimplemented_constexpr_lambda_feature_ast) << "captures not currently allowed"; return false; } @@ -3845,8 +3845,8 @@ static bool EvaluateVarDecl(EvalInfo &Info, const VarDecl *VD) { const Expr *InitE = VD->getInit(); if (!InitE) { - Info.FFDiag(VD->getLocStart(), diag::note_constexpr_uninitialized) - << false << VD->getType(); + Info.FFDiag(VD->getBeginLoc(), diag::note_constexpr_uninitialized) + << false << VD->getType(); Val = APValue(); return false; } @@ -3991,7 +3991,8 @@ static EvalStmtResult EvaluateSwitch(StmtResult &Result, EvalInfo &Info, case ESR_CaseNotFound: // This can only happen if the switch case is nested within a statement // expression. We have no intention of supporting that. - Info.FFDiag(Found->getLocStart(), diag::note_constexpr_stmt_expr_unsupported); + Info.FFDiag(Found->getBeginLoc(), + diag::note_constexpr_stmt_expr_unsupported); return ESR_Failed; } llvm_unreachable("Invalid EvalStmtResult!"); @@ -4082,7 +4083,7 @@ static EvalStmtResult EvaluateStmt(StmtResult &Result, EvalInfo &Info, return ESR_Succeeded; } - Info.FFDiag(S->getLocStart()); + Info.FFDiag(S->getBeginLoc()); return ESR_Failed; case Stmt::NullStmtClass: @@ -5077,8 +5078,8 @@ public: if (BI + 1 == BE) { const Expr *FinalExpr = dyn_cast<Expr>(*BI); if (!FinalExpr) { - Info.FFDiag((*BI)->getLocStart(), - diag::note_constexpr_stmt_expr_unsupported); + Info.FFDiag((*BI)->getBeginLoc(), + diag::note_constexpr_stmt_expr_unsupported); return false; } return this->Visit(FinalExpr); @@ -5092,8 +5093,8 @@ public: // 'break', or 'continue', it would be nice to propagate that to // the outer statement evaluation rather than bailing out. if (ESR != ESR_Failed) - Info.FFDiag((*BI)->getLocStart(), - diag::note_constexpr_stmt_expr_unsupported); + Info.FFDiag((*BI)->getBeginLoc(), + diag::note_constexpr_stmt_expr_unsupported); return false; } } @@ -10901,7 +10902,7 @@ static ICEDiag CheckEvalInICE(const Expr* E, const ASTContext &Ctx) { Expr::EvalResult EVResult; if (!E->EvaluateAsRValue(EVResult, Ctx) || EVResult.HasSideEffects || !EVResult.Val.isInt()) - return ICEDiag(IK_NotICE, E->getLocStart()); + return ICEDiag(IK_NotICE, E->getBeginLoc()); return NoDiag(); } @@ -10909,7 +10910,7 @@ static ICEDiag CheckEvalInICE(const Expr* E, const ASTContext &Ctx) { static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { assert(!E->isValueDependent() && "Should not see value dependent exprs!"); if (!E->getType()->isIntegralOrEnumerationType()) - return ICEDiag(IK_NotICE, E->getLocStart()); + return ICEDiag(IK_NotICE, E->getBeginLoc()); switch (E->getStmtClass()) { #define ABSTRACT_STMT(Node) @@ -10993,7 +10994,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { case Expr::CoawaitExprClass: case Expr::DependentCoawaitExprClass: case Expr::CoyieldExprClass: - return ICEDiag(IK_NotICE, E->getLocStart()); + return ICEDiag(IK_NotICE, E->getBeginLoc()); case Expr::InitListExprClass: { // C++03 [dcl.init]p13: If T is a scalar type, then a declaration of the @@ -11003,7 +11004,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { if (E->isRValue()) if (cast<InitListExpr>(E)->getNumInits() == 1) return CheckICE(cast<InitListExpr>(E)->getInit(0), Ctx); - return ICEDiag(IK_NotICE, E->getLocStart()); + return ICEDiag(IK_NotICE, E->getBeginLoc()); } case Expr::SizeOfPackExprClass: @@ -11038,7 +11039,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { const CallExpr *CE = cast<CallExpr>(E); if (CE->getBuiltinCallee()) return CheckEvalInICE(E, Ctx); - return ICEDiag(IK_NotICE, E->getLocStart()); + return ICEDiag(IK_NotICE, E->getBeginLoc()); } case Expr::DeclRefExprClass: { if (isa<EnumConstantDecl>(cast<DeclRefExpr>(E)->getDecl())) @@ -11068,7 +11069,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { return ICEDiag(IK_NotICE, cast<DeclRefExpr>(E)->getLocation()); } } - return ICEDiag(IK_NotICE, E->getLocStart()); + return ICEDiag(IK_NotICE, E->getBeginLoc()); } case Expr::UnaryOperatorClass: { const UnaryOperator *Exp = cast<UnaryOperator>(E); @@ -11083,7 +11084,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { // C99 6.6/3 allows increment and decrement within unevaluated // subexpressions of constant expressions, but they can never be ICEs // because an ICE cannot contain an lvalue operand. - return ICEDiag(IK_NotICE, E->getLocStart()); + return ICEDiag(IK_NotICE, E->getBeginLoc()); case UO_Extension: case UO_LNot: case UO_Plus: @@ -11110,7 +11111,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { const UnaryExprOrTypeTraitExpr *Exp = cast<UnaryExprOrTypeTraitExpr>(E); if ((Exp->getKind() == UETT_SizeOf) && Exp->getTypeOfArgument()->isVariableArrayType()) - return ICEDiag(IK_NotICE, E->getLocStart()); + return ICEDiag(IK_NotICE, E->getBeginLoc()); return NoDiag(); } case Expr::BinaryOperatorClass: { @@ -11132,7 +11133,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { // C99 6.6/3 allows assignments within unevaluated subexpressions of // constant expressions, but they can never be ICEs because an ICE cannot // contain an lvalue operand. - return ICEDiag(IK_NotICE, E->getLocStart()); + return ICEDiag(IK_NotICE, E->getBeginLoc()); case BO_Mul: case BO_Div: @@ -11161,11 +11162,11 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { if (LHSResult.Kind == IK_ICE && RHSResult.Kind == IK_ICE) { llvm::APSInt REval = Exp->getRHS()->EvaluateKnownConstInt(Ctx); if (REval == 0) - return ICEDiag(IK_ICEIfUnevaluated, E->getLocStart()); + return ICEDiag(IK_ICEIfUnevaluated, E->getBeginLoc()); if (REval.isSigned() && REval.isAllOnesValue()) { llvm::APSInt LEval = Exp->getLHS()->EvaluateKnownConstInt(Ctx); if (LEval.isMinSignedValue()) - return ICEDiag(IK_ICEIfUnevaluated, E->getLocStart()); + return ICEDiag(IK_ICEIfUnevaluated, E->getBeginLoc()); } } } @@ -11174,10 +11175,10 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { // C99 6.6p3 introduces a strange edge case: comma can be in an ICE // if it isn't evaluated. if (LHSResult.Kind == IK_ICE && RHSResult.Kind == IK_ICE) - return ICEDiag(IK_ICEIfUnevaluated, E->getLocStart()); + return ICEDiag(IK_ICEIfUnevaluated, E->getBeginLoc()); } else { // In both C89 and C++, commas in ICEs are illegal. - return ICEDiag(IK_NotICE, E->getLocStart()); + return ICEDiag(IK_NotICE, E->getBeginLoc()); } } return Worst(LHSResult, RHSResult); @@ -11222,7 +11223,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { if (FL->getValue().convertToInteger(IgnoredVal, llvm::APFloat::rmTowardZero, &Ignored) & APFloat::opInvalidOp) - return ICEDiag(IK_NotICE, E->getLocStart()); + return ICEDiag(IK_NotICE, E->getBeginLoc()); return NoDiag(); } } @@ -11235,7 +11236,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { case CK_IntegralCast: return CheckICE(SubExpr, Ctx); default: - return ICEDiag(IK_NotICE, E->getLocStart()); + return ICEDiag(IK_NotICE, E->getBeginLoc()); } } case Expr::BinaryConditionalOperatorClass: { |