diff options
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 2d921467f7..4531a46448 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -412,7 +412,7 @@ namespace { EvaluatingDeclValue = &Value; } - const LangOptions &getLangOpts() const { return Ctx.getLangOptions(); } + const LangOptions &getLangOpts() const { return Ctx.getLangOpts(); } bool CheckCallLimit(SourceLocation Loc) { // Don't perform any constexpr calls (other than the call we're checking) @@ -6057,7 +6057,7 @@ bool Expr::EvaluateAsRValue(EvalResult &Result, const ASTContext &Ctx) const { // FIXME: Evaluating values of large array and record types can cause // performance problems. Only do so in C++11 for now. if (isRValue() && (getType()->isArrayType() || getType()->isRecordType()) && - !Ctx.getLangOptions().CPlusPlus0x) + !Ctx.getLangOpts().CPlusPlus0x) return false; EvalInfo Info(Ctx, Result); @@ -6104,7 +6104,7 @@ bool Expr::EvaluateAsInitializer(APValue &Value, const ASTContext &Ctx, // FIXME: Evaluating initializers for large array and record types can cause // performance problems. Only do so in C++11 for now. if (isRValue() && (getType()->isArrayType() || getType()->isRecordType()) && - !Ctx.getLangOptions().CPlusPlus0x) + !Ctx.getLangOpts().CPlusPlus0x) return false; Expr::EvalStatus EStatus; @@ -6120,7 +6120,7 @@ bool Expr::EvaluateAsInitializer(APValue &Value, const ASTContext &Ctx, // Variables with static storage duration or thread storage duration shall be // zero-initialized before any other initialization takes place. // This behavior is not present in C. - if (Ctx.getLangOptions().CPlusPlus && !VD->hasLocalStorage() && + if (Ctx.getLangOpts().CPlusPlus && !VD->hasLocalStorage() && !VD->getType()->isReferenceType()) { ImplicitValueInitExpr VIE(VD->getType()); if (!EvaluateInPlace(Value, InitInfo, LVal, &VIE, CCEK_Constant, @@ -6325,7 +6325,7 @@ static ICEDiag CheckICE(const Expr* E, ASTContext &Ctx) { if (isa<EnumConstantDecl>(cast<DeclRefExpr>(E)->getDecl())) return NoDiag(); const ValueDecl *D = dyn_cast<ValueDecl>(cast<DeclRefExpr>(E)->getDecl()); - if (Ctx.getLangOptions().CPlusPlus && + if (Ctx.getLangOpts().CPlusPlus && D && IsConstNonVolatile(D->getType())) { // Parameter variables are never constants. Without this check, // getAnyInitializer() can find a default argument, which leads @@ -6448,7 +6448,7 @@ static ICEDiag CheckICE(const Expr* E, ASTContext &Ctx) { } } if (Exp->getOpcode() == BO_Comma) { - if (Ctx.getLangOptions().C99) { + if (Ctx.getLangOpts().C99) { // C99 6.6p3 introduces a strange edge case: comma can be in an ICE // if it isn't evaluated. if (LHSResult.Val == 0 && RHSResult.Val == 0) @@ -6593,7 +6593,7 @@ static bool EvaluateCPlusPlus11IntegralConstantExpr(ASTContext &Ctx, } bool Expr::isIntegerConstantExpr(ASTContext &Ctx, SourceLocation *Loc) const { - if (Ctx.getLangOptions().CPlusPlus0x) + if (Ctx.getLangOpts().CPlusPlus0x) return EvaluateCPlusPlus11IntegralConstantExpr(Ctx, this, 0, Loc); ICEDiag d = CheckICE(this, Ctx); @@ -6606,7 +6606,7 @@ bool Expr::isIntegerConstantExpr(ASTContext &Ctx, SourceLocation *Loc) const { bool Expr::isIntegerConstantExpr(llvm::APSInt &Value, ASTContext &Ctx, SourceLocation *Loc, bool isEvaluated) const { - if (Ctx.getLangOptions().CPlusPlus0x) + if (Ctx.getLangOpts().CPlusPlus0x) return EvaluateCPlusPlus11IntegralConstantExpr(Ctx, this, &Value, Loc); if (!isIntegerConstantExpr(Ctx, Loc)) @@ -6624,7 +6624,7 @@ bool Expr::isCXX11ConstantExpr(ASTContext &Ctx, APValue *Result, SourceLocation *Loc) const { // We support this checking in C++98 mode in order to diagnose compatibility // issues. - assert(Ctx.getLangOptions().CPlusPlus); + assert(Ctx.getLangOpts().CPlusPlus); // Build evaluation settings. Expr::EvalStatus Status; |