[clang] d009b98 - [AST] Use std::optional in OSLog.cpp (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 9 22:21:59 PST 2022
Author: Kazu Hirata
Date: 2022-12-09T22:21:54-08:00
New Revision: d009b985a84ce5a4251255dd138da6a687e9466b
URL: https://github.com/llvm/llvm-project/commit/d009b985a84ce5a4251255dd138da6a687e9466b
DIFF: https://github.com/llvm/llvm-project/commit/d009b985a84ce5a4251255dd138da6a687e9466b.diff
LOG: [AST] Use std::optional in OSLog.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:
clang/lib/AST/OSLog.cpp
Removed:
################################################################################
diff --git a/clang/lib/AST/OSLog.cpp b/clang/lib/AST/OSLog.cpp
index 40fa8c3802c3..5e320416b30d 100644
--- a/clang/lib/AST/OSLog.cpp
+++ b/clang/lib/AST/OSLog.cpp
@@ -8,6 +8,7 @@
#include "clang/AST/FormatString.h"
#include "clang/Basic/Builtins.h"
#include "llvm/ADT/SmallBitVector.h"
+#include <optional>
using namespace clang;
@@ -20,11 +21,11 @@ class OSLogFormatStringHandler
private:
struct ArgData {
const Expr *E = nullptr;
- Optional<OSLogBufferItem::Kind> Kind;
- Optional<unsigned> Size;
- Optional<const Expr *> Count;
- Optional<const Expr *> Precision;
- Optional<const Expr *> FieldWidth;
+ std::optional<OSLogBufferItem::Kind> Kind;
+ std::optional<unsigned> Size;
+ std::optional<const Expr *> Count;
+ std::optional<const Expr *> Precision;
+ std::optional<const Expr *> FieldWidth;
unsigned char Flags = 0;
StringRef MaskType;
};
More information about the cfe-commits
mailing list