LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OptSpecifier.h
Go to the documentation of this file.
1 //===--- OptSpecifier.h - Option Specifiers ---------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_OPTION_OPTSPECIFIER_H
11 #define LLVM_OPTION_OPTSPECIFIER_H
12 
13 namespace llvm {
14 namespace opt {
15  class Option;
16 
17  /// OptSpecifier - Wrapper class for abstracting references to option IDs.
18  class OptSpecifier {
19  unsigned ID;
20 
21  private:
22  explicit OptSpecifier(bool) LLVM_DELETED_FUNCTION;
23 
24  public:
25  OptSpecifier() : ID(0) {}
26  /*implicit*/ OptSpecifier(unsigned _ID) : ID(_ID) {}
27  /*implicit*/ OptSpecifier(const Option *Opt);
28 
29  bool isValid() const { return ID != 0; }
30 
31  unsigned getID() const { return ID; }
32 
33  bool operator==(OptSpecifier Opt) const { return ID == Opt.getID(); }
34  bool operator!=(OptSpecifier Opt) const { return !(*this == Opt); }
35  };
36 }
37 }
38 
39 #endif
unsigned getID() const
Definition: OptSpecifier.h:31
bool operator==(OptSpecifier Opt) const
Definition: OptSpecifier.h:33
bool operator!=(OptSpecifier Opt) const
Definition: OptSpecifier.h:34
#define LLVM_DELETED_FUNCTION
Definition: Compiler.h:137
OptSpecifier - Wrapper class for abstracting references to option IDs.
Definition: OptSpecifier.h:18
OptSpecifier(unsigned _ID)
Definition: OptSpecifier.h:26
bool isValid() const
Definition: OptSpecifier.h:29