Skip to content

Commit

Permalink
[clang][Interp][NFC] Return std::nullopt explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaederr committed Jul 4, 2023
1 parent 044be8f commit 843ff75
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions clang/lib/AST/Interp/Program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ std::optional<unsigned> Program::getGlobal(const ValueDecl *VD) {
// Map the decl to the existing index.
if (Index) {
GlobalIndices[VD] = *Index;
return {};
return std::nullopt;
}

return Index;
Expand All @@ -135,7 +135,7 @@ std::optional<unsigned> Program::getOrCreateGlobal(const ValueDecl *VD,
GlobalIndices[VD] = *Idx;
return Idx;
}
return {};
return std::nullopt;
}

std::optional<unsigned> Program::getOrCreateDummy(const ParmVarDecl *PD) {
Expand All @@ -154,7 +154,7 @@ std::optional<unsigned> Program::getOrCreateDummy(const ParmVarDecl *PD) {
DummyParams[PD] = *Idx;
return Idx;
}
return {};
return std::nullopt;
}

std::optional<unsigned> Program::createGlobal(const ValueDecl *VD,
Expand All @@ -173,7 +173,7 @@ std::optional<unsigned> Program::createGlobal(const ValueDecl *VD,
GlobalIndices[P] = *Idx;
return *Idx;
}
return {};
return std::nullopt;
}

std::optional<unsigned> Program::createGlobal(const Expr *E) {
Expand All @@ -194,7 +194,7 @@ std::optional<unsigned> Program::createGlobal(const DeclTy &D, QualType Ty,
IsTemporary);
}
if (!Desc)
return {};
return std::nullopt;

// Allocate a block for storage.
unsigned I = Globals.size();
Expand Down

0 comments on commit 843ff75

Please sign in to comment.