From f5360d4bb3376347479d86547d21b95d80be786d Mon Sep 17 00:00:00 2001 From: Melanie Blower Date: Fri, 1 May 2020 10:32:06 -0700 Subject: Reapply "Add support for #pragma float_control" with buildbot fixes Add support for #pragma float_control Reviewers: rjmccall, erichkeane, sepavloff Differential Revision: https://reviews.llvm.org/D72841 This reverts commit fce82c0ed310174fe48e2402ac731b6340098389. --- clang/lib/Sema/SemaPseudoObject.cpp | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'clang/lib/Sema/SemaPseudoObject.cpp') diff --git a/clang/lib/Sema/SemaPseudoObject.cpp b/clang/lib/Sema/SemaPseudoObject.cpp index 0ed4522..da77720 100644 --- a/clang/lib/Sema/SemaPseudoObject.cpp +++ b/clang/lib/Sema/SemaPseudoObject.cpp @@ -127,12 +127,10 @@ namespace { if (UnaryOperator *uop = dyn_cast(e)) { assert(uop->getOpcode() == UO_Extension); e = rebuild(uop->getSubExpr()); - return new (S.Context) UnaryOperator(e, uop->getOpcode(), - uop->getType(), - uop->getValueKind(), - uop->getObjectKind(), - uop->getOperatorLoc(), - uop->canOverflow()); + return UnaryOperator::Create( + S.Context, e, uop->getOpcode(), uop->getType(), uop->getValueKind(), + uop->getObjectKind(), uop->getOperatorLoc(), uop->canOverflow(), + S.CurFPFeatures); } if (GenericSelectionExpr *gse = dyn_cast(e)) { @@ -526,12 +524,14 @@ PseudoOpBuilder::buildIncDecOperation(Scope *Sc, SourceLocation opcLoc, (result.get()->isTypeDependent() || CanCaptureValue(result.get()))) setResultToLastSemantic(); - UnaryOperator *syntactic = new (S.Context) UnaryOperator( - syntacticOp, opcode, resultType, VK_LValue, OK_Ordinary, opcLoc, - !resultType->isDependentType() - ? S.Context.getTypeSize(resultType) >= - S.Context.getTypeSize(S.Context.IntTy) - : false); + UnaryOperator *syntactic = + UnaryOperator::Create(S.Context, syntacticOp, opcode, resultType, + VK_LValue, OK_Ordinary, opcLoc, + !resultType->isDependentType() + ? S.Context.getTypeSize(resultType) >= + S.Context.getTypeSize(S.Context.IntTy) + : false, + S.CurFPFeatures); return complete(syntactic); } @@ -1551,8 +1551,9 @@ ExprResult Sema::checkPseudoObjectIncDec(Scope *Sc, SourceLocation opcLoc, UnaryOperatorKind opcode, Expr *op) { // Do nothing if the operand is dependent. if (op->isTypeDependent()) - return new (Context) UnaryOperator(op, opcode, Context.DependentTy, - VK_RValue, OK_Ordinary, opcLoc, false); + return UnaryOperator::Create(Context, op, opcode, Context.DependentTy, + VK_RValue, OK_Ordinary, opcLoc, false, + CurFPFeatures); assert(UnaryOperator::isIncrementDecrementOp(opcode)); Expr *opaqueRef = op->IgnoreParens(); @@ -1636,9 +1637,10 @@ Expr *Sema::recreateSyntacticForm(PseudoObjectExpr *E) { Expr *syntax = E->getSyntacticForm(); if (UnaryOperator *uop = dyn_cast(syntax)) { Expr *op = stripOpaqueValuesFromPseudoObjectRef(*this, uop->getSubExpr()); - return new (Context) UnaryOperator( - op, uop->getOpcode(), uop->getType(), uop->getValueKind(), - uop->getObjectKind(), uop->getOperatorLoc(), uop->canOverflow()); + return UnaryOperator::Create(Context, op, uop->getOpcode(), uop->getType(), + uop->getValueKind(), uop->getObjectKind(), + uop->getOperatorLoc(), uop->canOverflow(), + CurFPFeatures); } else if (CompoundAssignOperator *cop = dyn_cast(syntax)) { Expr *lhs = stripOpaqueValuesFromPseudoObjectRef(*this, cop->getLHS()); -- cgit v1.1