diff options
Diffstat (limited to 'clang/lib/Analysis/BodyFarm.cpp')
| -rw-r--r-- | clang/lib/Analysis/BodyFarm.cpp | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/clang/lib/Analysis/BodyFarm.cpp b/clang/lib/Analysis/BodyFarm.cpp index f9f0553d28f0..603da6715625 100644 --- a/clang/lib/Analysis/BodyFarm.cpp +++ b/clang/lib/Analysis/BodyFarm.cpp @@ -166,23 +166,21 @@ ASTMaker::makeLvalueToRvalue(const VarDecl *Arg, ImplicitCastExpr *ASTMaker::makeImplicitCast(const Expr *Arg, QualType Ty, CastKind CK) { return ImplicitCastExpr::Create(C, Ty, - /* CastKind=*/ CK, - /* Expr=*/ const_cast<Expr *>(Arg), - /* CXXCastPath=*/ nullptr, - /* ExprValueKind=*/ VK_RValue); + /* CastKind=*/CK, + /* Expr=*/const_cast<Expr *>(Arg), + /* CXXCastPath=*/nullptr, + /* ExprValueKind=*/VK_RValue, + /* FPFeatures */ FPOptionsOverride()); } Expr *ASTMaker::makeIntegralCast(const Expr *Arg, QualType Ty) { if (Arg->getType() == Ty) return const_cast<Expr*>(Arg); - - return ImplicitCastExpr::Create(C, Ty, CK_IntegralCast, - const_cast<Expr*>(Arg), nullptr, VK_RValue); + return makeImplicitCast(Arg, Ty, CK_IntegralCast); } ImplicitCastExpr *ASTMaker::makeIntegralCastToBoolean(const Expr *Arg) { - return ImplicitCastExpr::Create(C, C.BoolTy, CK_IntegralToBoolean, - const_cast<Expr*>(Arg), nullptr, VK_RValue); + return makeImplicitCast(Arg, C.BoolTy, CK_IntegralToBoolean); } ObjCBoolLiteralExpr *ASTMaker::makeObjCBool(bool Val) { @@ -267,7 +265,7 @@ static CallExpr *create_call_once_funcptr_call(ASTContext &C, ASTMaker M, } return CallExpr::Create(C, SubExpr, CallArgs, C.VoidTy, VK_RValue, - SourceLocation()); + SourceLocation(), FPOptionsOverride()); } static CallExpr *create_call_once_lambda_call(ASTContext &C, ASTMaker M, @@ -468,6 +466,8 @@ static Stmt *create_call_once(ASTContext &C, const FunctionDecl *D) { /* Init=*/nullptr, /* Var=*/nullptr, /* Cond=*/FlagCheck, + /* LPL=*/SourceLocation(), + /* RPL=*/SourceLocation(), /* Then=*/M.makeCompound({CallbackCall, FlagAssignment})); return Out; @@ -514,7 +514,7 @@ static Stmt *create_dispatch_once(ASTContext &C, const FunctionDecl *D) { /*Args=*/None, /*QualType=*/C.VoidTy, /*ExprValueType=*/VK_RValue, - /*SourceLocation=*/SourceLocation()); + /*SourceLocation=*/SourceLocation(), FPOptionsOverride()); // (2) Create the assignment to the predicate. Expr *DoneValue = @@ -552,6 +552,8 @@ static Stmt *create_dispatch_once(ASTContext &C, const FunctionDecl *D) { /* Init=*/nullptr, /* Var=*/nullptr, /* Cond=*/GuardCondition, + /* LPL=*/SourceLocation(), + /* RPL=*/SourceLocation(), /* Then=*/CS); return If; } @@ -578,8 +580,8 @@ static Stmt *create_dispatch_sync(ASTContext &C, const FunctionDecl *D) { ASTMaker M(C); DeclRefExpr *DR = M.makeDeclRefExpr(PV); ImplicitCastExpr *ICE = M.makeLvalueToRvalue(DR, Ty); - CallExpr *CE = - CallExpr::Create(C, ICE, None, C.VoidTy, VK_RValue, SourceLocation()); + CallExpr *CE = CallExpr::Create(C, ICE, None, C.VoidTy, VK_RValue, + SourceLocation(), FPOptionsOverride()); return CE; } @@ -655,11 +657,13 @@ static Stmt *create_OSAtomicCompareAndSwap(ASTContext &C, const FunctionDecl *D) Stmt *Else = M.makeReturn(RetVal); /// Construct the If. - auto *If = IfStmt::Create(C, SourceLocation(), - /* IsConstexpr=*/false, - /* Init=*/nullptr, - /* Var=*/nullptr, Comparison, Body, - SourceLocation(), Else); + auto *If = + IfStmt::Create(C, SourceLocation(), + /* IsConstexpr=*/false, + /* Init=*/nullptr, + /* Var=*/nullptr, Comparison, + /* LPL=*/SourceLocation(), + /* RPL=*/SourceLocation(), Body, SourceLocation(), Else); return If; } |
