[clang] 50ba59d - [AST] Use std::optional in ExprConstant.cpp (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 9 22:19:51 PST 2022
Author: Kazu Hirata
Date: 2022-12-09T22:19:46-08:00
New Revision: 50ba59d1b659558a06273003bbf28227323a055f
URL: https://github.com/llvm/llvm-project/commit/50ba59d1b659558a06273003bbf28227323a055f
DIFF: https://github.com/llvm/llvm-project/commit/50ba59d1b659558a06273003bbf28227323a055f.diff
LOG: [AST] Use std::optional in ExprConstant.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/ExprConstant.cpp
Removed:
################################################################################
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index ce9774422b12..280b37adc032 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -60,6 +60,7 @@
#include "llvm/Support/raw_ostream.h"
#include <cstring>
#include <functional>
+#include <optional>
#define DEBUG_TYPE "exprconstant"
@@ -6833,7 +6834,7 @@ class BitCastBuffer {
// FIXME: Its possible under the C++ standard for 'char' to not be 8 bits, but
// we don't support a host or target where that is the case. Still, we should
// use a more generic type in case we ever do.
- SmallVector<Optional<unsigned char>, 32> Bytes;
+ SmallVector<std::optional<unsigned char>, 32> Bytes;
static_assert(std::numeric_limits<unsigned char>::digits >= 8,
"Need at least 8 bit unsigned char");
More information about the cfe-commits
mailing list