From 843ff7581408a02e852c0f1f7ebf176cabbc7527 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Mon, 19 Jun 2023 09:15:04 +0200 Subject: [PATCH] [clang][Interp][NFC] Return std::nullopt explicitly --- clang/lib/AST/Interp/Program.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/clang/lib/AST/Interp/Program.cpp b/clang/lib/AST/Interp/Program.cpp index f6f378d..a974902 100644 --- a/clang/lib/AST/Interp/Program.cpp +++ b/clang/lib/AST/Interp/Program.cpp @@ -120,7 +120,7 @@ std::optional Program::getGlobal(const ValueDecl *VD) { // Map the decl to the existing index. if (Index) { GlobalIndices[VD] = *Index; - return {}; + return std::nullopt; } return Index; @@ -135,7 +135,7 @@ std::optional Program::getOrCreateGlobal(const ValueDecl *VD, GlobalIndices[VD] = *Idx; return Idx; } - return {}; + return std::nullopt; } std::optional Program::getOrCreateDummy(const ParmVarDecl *PD) { @@ -154,7 +154,7 @@ std::optional Program::getOrCreateDummy(const ParmVarDecl *PD) { DummyParams[PD] = *Idx; return Idx; } - return {}; + return std::nullopt; } std::optional Program::createGlobal(const ValueDecl *VD, @@ -173,7 +173,7 @@ std::optional Program::createGlobal(const ValueDecl *VD, GlobalIndices[P] = *Idx; return *Idx; } - return {}; + return std::nullopt; } std::optional Program::createGlobal(const Expr *E) { @@ -194,7 +194,7 @@ std::optional Program::createGlobal(const DeclTy &D, QualType Ty, IsTemporary); } if (!Desc) - return {}; + return std::nullopt; // Allocate a block for storage. unsigned I = Globals.size(); -- 2.7.4