LLVM  17.0.0git
Optional.h
Go to the documentation of this file.
1 //===- Optional.h - Simple variant for passing optional values --*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// This file provides Optional, a template class modeled in the spirit of
11 /// OCaml's 'opt' variant. The idea is to strongly type whether or not
12 /// a value can be optional.
13 ///
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_ADT_OPTIONAL_H
17 #define LLVM_ADT_OPTIONAL_H
18 
19 #include <optional>
20 
21 namespace llvm {
22 // Legacy alias of llvm::Optional to std::optional.
23 // FIXME: Remove this after LLVM 16.
24 template <class T> using Optional = std::optional<T>;
25 } // namespace llvm
26 
27 #endif // LLVM_ADT_OPTIONAL_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::Optional
std::optional< T > Optional
Definition: Optional.h:24