From 6ad0788c332bb2043142954d300c49ac3e537f34 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 14 Jan 2023 12:31:01 -0800 Subject: [clang] Use std::optional instead of llvm::Optional (NFC) This patch replaces (llvm::|)Optional< with std::optional<. I'll post a separate patch to remove #include "llvm/ADT/Optional.h". 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 --- clang/lib/CodeGen/CodeGenFunction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 6dafd4a..55464e1 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -364,7 +364,7 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) { if (HasCleanups) { // Make sure the line table doesn't jump back into the body for // the ret after it's been at EndLoc. - Optional AL; + std::optional AL; if (CGDebugInfo *DI = getDebugInfo()) { if (OnlySimpleReturnStmts) DI->EmitLocation(Builder, EndLoc); @@ -505,7 +505,7 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) { llvm::utostr(LargestVectorWidth)); // Add vscale_range attribute if appropriate. - Optional> VScaleRange = + std::optional> VScaleRange = getContext().getTargetInfo().getVScaleRange(getLangOpts()); if (VScaleRange) { CurFn->addFnAttr(llvm::Attribute::getWithVScaleRangeArgs( -- cgit v1.1