aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorMatheus Izvekov <mizvekov@gmail.com>2025-04-03 14:27:18 -0300
committerGitHub <noreply@github.com>2025-04-03 14:27:18 -0300
commitcfee056b4e75cd941591d298e0f8dc303460c57e (patch)
tree03f3bf29ef837c5e3e3bc3ddeff2d7fe714ad42d /clang/lib/Sema/Sema.cpp
parent262b9b515330daf7c446cc7983bf5f89185b3666 (diff)
downloadllvm-cfee056b4e75cd941591d298e0f8dc303460c57e.zip
llvm-cfee056b4e75cd941591d298e0f8dc303460c57e.tar.gz
llvm-cfee056b4e75cd941591d298e0f8dc303460c57e.tar.bz2
[clang] NFC: introduce UnsignedOrNone as a replacement for std::optional<unsigned> (#134142)
This introduces a new class 'UnsignedOrNone', which models a lite version of `std::optional<unsigned>`, but has the same size as 'unsigned'. This replaces most uses of `std::optional<unsigned>`, and similar schemes utilizing 'int' and '-1' as sentinel. Besides the smaller size advantage, this is simpler to serialize, as its internal representation is a single unsigned int as well.
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r--clang/lib/Sema/Sema.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 93a2d79..64f5633 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -263,7 +263,7 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer,
TyposCorrected(0), IsBuildingRecoveryCallExpr(false), NumSFINAEErrors(0),
AccessCheckingSFINAE(false), CurrentInstantiationScope(nullptr),
InNonInstantiationSFINAEContext(false), NonInstantiationEntries(0),
- ArgumentPackSubstitutionIndex(-1), SatisfactionCache(Context) {
+ ArgPackSubstIndex(std::nullopt), SatisfactionCache(Context) {
assert(pp.TUKind == TUKind);
TUScope = nullptr;