diff options
Diffstat (limited to 'clang/lib/Analysis/BodyFarm.cpp')
-rw-r--r-- | clang/lib/Analysis/BodyFarm.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Analysis/BodyFarm.cpp b/clang/lib/Analysis/BodyFarm.cpp index 38f100ae0a4f..c05534886cb5 100644 --- a/clang/lib/Analysis/BodyFarm.cpp +++ b/clang/lib/Analysis/BodyFarm.cpp @@ -24,6 +24,7 @@ #include "clang/Basic/OperatorKinds.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/Support/Debug.h" +#include <optional> #define DEBUG_TYPE "body-farm" @@ -541,7 +542,7 @@ static Stmt *create_dispatch_once(ASTContext &C, const FunctionDecl *D) { CallExpr *CE = CallExpr::Create( /*ASTContext=*/C, /*StmtClass=*/M.makeLvalueToRvalue(/*Expr=*/Block), - /*Args=*/None, + /*Args=*/std::nullopt, /*QualType=*/C.VoidTy, /*ExprValueType=*/VK_PRValue, /*SourceLocation=*/SourceLocation(), FPOptionsOverride()); @@ -609,7 +610,7 @@ 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_PRValue, + CallExpr *CE = CallExpr::Create(C, ICE, std::nullopt, C.VoidTy, VK_PRValue, SourceLocation(), FPOptionsOverride()); return CE; } @@ -697,9 +698,9 @@ static Stmt *create_OSAtomicCompareAndSwap(ASTContext &C, const FunctionDecl *D) } Stmt *BodyFarm::getBody(const FunctionDecl *D) { - Optional<Stmt *> &Val = Bodies[D]; + std::optional<Stmt *> &Val = Bodies[D]; if (Val) - return Val.value(); + return *Val; Val = nullptr; @@ -872,9 +873,9 @@ Stmt *BodyFarm::getBody(const ObjCMethodDecl *D) { if (!D->isImplicit()) return nullptr; - Optional<Stmt *> &Val = Bodies[D]; + std::optional<Stmt *> &Val = Bodies[D]; if (Val) - return Val.value(); + return *Val; Val = nullptr; // For now, we only synthesize getters. |