Skip to content

Commit

Permalink
cmake: Disable C++ operator names. (cvc5#10928)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpreiner authored Jun 14, 2024
1 parent 3f85790 commit 047124b
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 44 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ add_check_cxx_flag("-Wsuggest-override")
add_check_cxx_flag("-Wnon-virtual-dtor")
add_check_c_cxx_flag("-Wimplicit-fallthrough")
add_check_c_cxx_flag("-Wshadow")
add_check_c_cxx_flag("-fno-operator-names")

# Assume no dynamic initialization of thread-local variables in non-defining
# translation units. This option should result in better performance and works
Expand Down
2 changes: 1 addition & 1 deletion src/preprocessing/passes/ackermann.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void usortsToBitVectors(const LogicInfo& d_logic,
if (toProcess.size() > 0)
{
/* the current version only supports BV for removing uninterpreted sorts */
if (not d_logic.isTheoryEnabled(theory::THEORY_BV))
if (!d_logic.isTheoryEnabled(theory::THEORY_BV))
{
return;
}
Expand Down
78 changes: 38 additions & 40 deletions src/smt/set_defaults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ void SetDefaults::setDefaultsPost(const LogicInfo& logic, Options& opts) const
// Turn off array eager index splitting for QF_AUFLIA
if (!opts.arrays.arraysEagerIndexSplittingWasSetByUser)
{
if (not logic.isQuantified() && logic.isTheoryEnabled(THEORY_ARRAYS)
if (!logic.isQuantified() && logic.isTheoryEnabled(THEORY_ARRAYS)
&& logic.isTheoryEnabled(THEORY_UF)
&& logic.isTheoryEnabled(THEORY_ARITH))
{
Expand Down Expand Up @@ -1679,51 +1679,49 @@ void SetDefaults::setDefaultDecisionMode(const LogicInfo& logic,
usesSygus(opts) ? options::DecisionMode::INTERNAL :
// ALL or its supersets
logic.hasEverything()
? options::DecisionMode::JUSTIFICATION
: ( // QF_BV
(not logic.isQuantified() && logic.isPure(THEORY_BV)) ||
// QF_AUFBV or QF_ABV or QF_UFBV
(not logic.isQuantified()
&& (logic.isTheoryEnabled(THEORY_ARRAYS)
|| logic.isTheoryEnabled(THEORY_UF))
&& logic.isTheoryEnabled(THEORY_BV))
||
// QF_AUFLIA (and may be ends up enabling
// QF_AUFLRA?)
(not logic.isQuantified()
&& logic.isTheoryEnabled(THEORY_ARRAYS)
&& logic.isTheoryEnabled(THEORY_UF)
&& logic.isTheoryEnabled(THEORY_ARITH))
||
// QF_LRA
(not logic.isQuantified()
&& logic.isPure(THEORY_ARITH) && logic.isLinear()
&& !logic.isDifferenceLogic()
&& !logic.areIntegersUsed())
||
// Quantifiers
logic.isQuantified() ||
// Strings
logic.isTheoryEnabled(THEORY_STRINGS)
? options::DecisionMode::JUSTIFICATION
: options::DecisionMode::INTERNAL);
? options::DecisionMode::JUSTIFICATION
: ( // QF_BV
(!logic.isQuantified() && logic.isPure(THEORY_BV)) ||
// QF_AUFBV or QF_ABV or QF_UFBV
(!logic.isQuantified()
&& (logic.isTheoryEnabled(THEORY_ARRAYS)
|| logic.isTheoryEnabled(THEORY_UF))
&& logic.isTheoryEnabled(THEORY_BV))
||
// QF_AUFLIA (and may be ends up enabling
// QF_AUFLRA?)
(!logic.isQuantified()
&& logic.isTheoryEnabled(THEORY_ARRAYS)
&& logic.isTheoryEnabled(THEORY_UF)
&& logic.isTheoryEnabled(THEORY_ARITH))
||
// QF_LRA
(!logic.isQuantified() && logic.isPure(THEORY_ARITH)
&& logic.isLinear() && !logic.isDifferenceLogic()
&& !logic.areIntegersUsed())
||
// Quantifiers
logic.isQuantified() ||
// Strings
logic.isTheoryEnabled(THEORY_STRINGS)
? options::DecisionMode::JUSTIFICATION
: options::DecisionMode::INTERNAL);

bool stoponly =
// ALL or its supersets
logic.hasEverything() || logic.isTheoryEnabled(THEORY_STRINGS)
? false
: ( // QF_AUFLIA
(not logic.isQuantified()
&& logic.isTheoryEnabled(THEORY_ARRAYS)
&& logic.isTheoryEnabled(THEORY_UF)
&& logic.isTheoryEnabled(THEORY_ARITH))
||
// QF_LRA
(not logic.isQuantified() && logic.isPure(THEORY_ARITH)
&& logic.isLinear() && !logic.isDifferenceLogic()
&& !logic.areIntegersUsed())
? true
: false);
(!logic.isQuantified() && logic.isTheoryEnabled(THEORY_ARRAYS)
&& logic.isTheoryEnabled(THEORY_UF)
&& logic.isTheoryEnabled(THEORY_ARITH))
||
// QF_LRA
(!logic.isQuantified() && logic.isPure(THEORY_ARITH)
&& logic.isLinear() && !logic.isDifferenceLogic()
&& !logic.areIntegersUsed())
? true
: false);

if (stoponly)
{
Expand Down
2 changes: 1 addition & 1 deletion src/theory/arith/linear/constraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ void Constraint::printProofTree(std::ostream& out, size_t depth) const
bool first = true;
for (const auto& coeff : *rule.d_farkasCoefficients)
{
if (not first)
if (!first)
{
out << ", ";
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/gmp_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ inline size_t gmpz_hash(const mpz_t toHash) {
for (int i = 0, n = mpz_size(toHash); i < n; ++i){
mp_limb_t limb = mpz_getlimbn(toHash, i);
hash = hash * 2;
hash = hash xor limb;
hash = hash ^ limb;
}
return hash;
}/* gmpz_hash() */
Expand Down
2 changes: 1 addition & 1 deletion src/util/rational_gmp_imp.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ class Rational
size_t numeratorHash = gmpz_hash(d_value.get_num_mpz_t());
size_t denominatorHash = gmpz_hash(d_value.get_den_mpz_t());

return numeratorHash xor denominatorHash;
return numeratorHash ^ denominatorHash;
}

uint32_t complexity() const
Expand Down

0 comments on commit 047124b

Please sign in to comment.