[llvm] 1a20dad - [Support] Use std::optional in FormatVariadic.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 25 21:25:32 PST 2022


Author: Kazu Hirata
Date: 2022-11-25T21:25:27-08:00
New Revision: 1a20dade4d4f4ccd2383657cb638a27602ff7606

URL: https://github.com/llvm/llvm-project/commit/1a20dade4d4f4ccd2383657cb638a27602ff7606
DIFF: https://github.com/llvm/llvm-project/commit/1a20dade4d4f4ccd2383657cb638a27602ff7606.diff

LOG: [Support] Use std::optional in FormatVariadic.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

Added: 
    

Modified: 
    llvm/lib/Support/FormatVariadic.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/FormatVariadic.cpp b/llvm/lib/Support/FormatVariadic.cpp
index 0709d65e81e0..19e5f9d63178 100644
--- a/llvm/lib/Support/FormatVariadic.cpp
+++ b/llvm/lib/Support/FormatVariadic.cpp
@@ -7,10 +7,11 @@
 
 #include "llvm/Support/FormatVariadic.h"
 #include <cassert>
+#include <optional>
 
 using namespace llvm;
 
-static Optional<AlignStyle> translateLocChar(char C) {
+static std::optional<AlignStyle> translateLocChar(char C) {
   switch (C) {
   case '-':
     return AlignStyle::Left;


        


More information about the llvm-commits mailing list