Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/Option/OptSpecifier.h
Line
Count
Source (jump to first uncovered line)
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
//===----------------------------------------------------------------------===//
8
9
#ifndef LLVM_OPTION_OPTSPECIFIER_H
10
#define LLVM_OPTION_OPTSPECIFIER_H
11
12
namespace llvm {
13
namespace opt {
14
15
class Option;
16
17
/// OptSpecifier - Wrapper class for abstracting references to option IDs.
18
class OptSpecifier {
19
  unsigned ID = 0;
20
21
public:
22
126M
  OptSpecifier() = default;
23
  explicit OptSpecifier(bool) = delete;
24
740M
  /*implicit*/ OptSpecifier(unsigned ID) : ID(ID) {}
25
  /*implicit*/ OptSpecifier(const Option *Opt);
26
27
4.80M
  bool isValid() const { return ID != 0; }
28
29
730M
  unsigned getID() const { return ID; }
30
31
0
  bool operator==(OptSpecifier Opt) const { return ID == Opt.getID(); }
32
0
  bool operator!=(OptSpecifier Opt) const { return !(*this == Opt); }
33
};
34
35
} // end namespace opt
36
} // end namespace llvm
37
38
#endif // LLVM_OPTION_OPTSPECIFIER_H