[InstCombine] Signed saturation patterns
[llvm-complete.git] / include / llvm / Option / OptSpecifier.h
blob7a5fcfb18b388625dbbb98ea303edcf1e1a56a1c
1 //===- OptSpecifier.h - Option Specifiers -----------------------*- 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 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_OPTION_OPTSPECIFIER_H
10 #define LLVM_OPTION_OPTSPECIFIER_H
12 namespace llvm {
13 namespace opt {
15 class Option;
17 /// OptSpecifier - Wrapper class for abstracting references to option IDs.
18 class OptSpecifier {
19 unsigned ID = 0;
21 public:
22 OptSpecifier() = default;
23 explicit OptSpecifier(bool) = delete;
24 /*implicit*/ OptSpecifier(unsigned ID) : ID(ID) {}
25 /*implicit*/ OptSpecifier(const Option *Opt);
27 bool isValid() const { return ID != 0; }
29 unsigned getID() const { return ID; }
31 bool operator==(OptSpecifier Opt) const { return ID == Opt.getID(); }
32 bool operator!=(OptSpecifier Opt) const { return !(*this == Opt); }
35 } // end namespace opt
36 } // end namespace llvm
38 #endif // LLVM_OPTION_OPTSPECIFIER_H