GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/options/parser_options.h Lines: 1 1 100.0 %
Date: 2021-08-06 Branches: 0 0 0.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Mathias Preiner, Aina Niemetz
4
 *
5
 * This file is part of the cvc5 project.
6
 *
7
 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8
 * in the top-level source directory and their institutional affiliations.
9
 * All rights reserved.  See the file COPYING in the top-level source
10
 * directory for licensing information.
11
 * ****************************************************************************
12
 *
13
 * Contains code for handling command-line options.
14
 *
15
 * For each <module>_options.toml configuration file, mkoptions.py
16
 * expands this template and generates a <module>_options.h file.
17
 */
18
19
#include "cvc5_public.h"
20
21
#ifndef CVC5__OPTIONS__PARSER_H
22
#define CVC5__OPTIONS__PARSER_H
23
24
#include "options/options.h"
25
26
// clang-format off
27
28
// clang-format on
29
30
namespace cvc5 {
31
namespace options {
32
33
// clang-format off
34
35
// clang-format on
36
37
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE)
38
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT false
39
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
40
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT true
41
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
42
43
69180
struct HolderPARSER
44
{
45
// clang-format off
46
  bool filesystemAccess = true;
47
  bool filesystemAccessWasSetByUser = false;
48
  std::string forceLogicString;
49
  bool forceLogicStringWasSetByUser = false;
50
  bool globalDeclarations = false;
51
  bool globalDeclarationsWasSetByUser = false;
52
  bool memoryMap;
53
  bool memoryMapWasSetByUser = false;
54
  bool semanticChecks = DO_SEMANTIC_CHECKS_BY_DEFAULT;
55
  bool semanticChecksWasSetByUser = false;
56
  bool strictParsing;
57
  bool strictParsingWasSetByUser = false;
58
// clang-format on
59
};
60
61
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT
62
63
// clang-format off
64
extern struct filesystemAccess__option_t
65
{
66
  typedef bool type;
67
  type operator()() const;
68
} thread_local filesystemAccess;
69
extern struct forceLogicString__option_t
70
{
71
  typedef std::string type;
72
  type operator()() const;
73
} thread_local forceLogicString;
74
extern struct globalDeclarations__option_t
75
{
76
  typedef bool type;
77
  type operator()() const;
78
} thread_local globalDeclarations;
79
extern struct memoryMap__option_t
80
{
81
  typedef bool type;
82
  type operator()() const;
83
} thread_local memoryMap;
84
extern struct semanticChecks__option_t
85
{
86
  typedef bool type;
87
  type operator()() const;
88
} thread_local semanticChecks;
89
extern struct strictParsing__option_t
90
{
91
  typedef bool type;
92
  type operator()() const;
93
} thread_local strictParsing;
94
// clang-format on
95
96
namespace parser
97
{
98
// clang-format off
99
static constexpr const char* filesystemAccess__name = "filesystem-access";
100
static constexpr const char* forceLogicString__name = "force-logic";
101
static constexpr const char* globalDeclarations__name = "global-declarations";
102
static constexpr const char* memoryMap__name = "mmap";
103
static constexpr const char* semanticChecks__name = "semantic-checks";
104
static constexpr const char* strictParsing__name = "strict-parsing";
105
// clang-format on
106
}
107
108
}  // namespace options
109
110
// clang-format off
111
112
// clang-format on
113
114
namespace options {
115
// clang-format off
116
inline bool filesystemAccess__option_t::operator()() const
117
{ return Options::current().parser.filesystemAccess; }
118
inline std::string forceLogicString__option_t::operator()() const
119
{ return Options::current().parser.forceLogicString; }
120
inline bool globalDeclarations__option_t::operator()() const
121
{ return Options::current().parser.globalDeclarations; }
122
inline bool memoryMap__option_t::operator()() const
123
{ return Options::current().parser.memoryMap; }
124
inline bool semanticChecks__option_t::operator()() const
125
{ return Options::current().parser.semanticChecks; }
126
inline bool strictParsing__option_t::operator()() const
127
{ return Options::current().parser.strictParsing; }
128
// clang-format on
129
130
namespace parser
131
{
132
// clang-format off
133
void setDefaultFilesystemAccess(Options& opts, bool value);
134
void setDefaultForceLogicString(Options& opts, std::string value);
135
void setDefaultGlobalDeclarations(Options& opts, bool value);
136
void setDefaultMemoryMap(Options& opts, bool value);
137
void setDefaultSemanticChecks(Options& opts, bool value);
138
void setDefaultStrictParsing(Options& opts, bool value);
139
// clang-format on
140
}
141
142
}  // namespace options
143
}  // namespace cvc5
144
145
#endif /* CVC5__OPTIONS__PARSER_H */