From d7fdb5d87b3c8234423d1dc8c012c4310a126600 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 25 Nov 2022 23:15:51 -0800 Subject: [PATCH] [Coroutines] Use std::optional in CoroElide.cpp (NFC) This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 --- llvm/lib/Transforms/Coroutines/CoroElide.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Coroutines/CoroElide.cpp b/llvm/lib/Transforms/Coroutines/CoroElide.cpp index 9916de0..fcb3b3e 100644 --- a/llvm/lib/Transforms/Coroutines/CoroElide.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroElide.cpp @@ -16,6 +16,7 @@ #include "llvm/IR/InstIterator.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FileSystem.h" +#include using namespace llvm; @@ -101,7 +102,8 @@ static void removeTailCallAttribute(AllocaInst *Frame, AAResults &AA) { // Given a resume function @f.resume(%f.frame* %frame), returns the size // and expected alignment of %f.frame type. -static Optional> getFrameLayout(Function *Resume) { +static std::optional> +getFrameLayout(Function *Resume) { // Pull information from the function attributes. auto Size = Resume->getParamDereferenceableBytes(0); if (!Size) -- 2.7.4