AC_MSG_CHECKING([compatibility with version of swig])
cat > conftest.c << _CVC4EOF
%module conftest
-#if !defined(SWIG_VERSION) || SWIG_VERSION < 0x020000
+#if !defined(SWIG_VERSION) || SWIG_VERSION < 0x030000
#error bad version
#endif
_CVC4EOF
AC_MSG_RESULT([compatible version])
else
AC_MSG_RESULT([incompatible version])
- AC_MSG_WARN([swig version 2.0.0 or later is required to build native API bindings])
+ AC_MSG_WARN([swig version 3.0.0 or later is required to build native API bindings])
SWIG=
echo '===Failed swig input was:' >&AS_MESSAGE_LOG_FD
cat conftest.c >&AS_MESSAGE_LOG_FD
listener.h \
modal_exception.h \
output.cpp \
- output.h \
- tls.h
+ output.h
# listing {Debug,Trace}_tags too ensures that make doesn't auto-remove it
# after building (if it does, we don't get the "cached" effect with
#include "base/cvc4_assert.h"
#include "base/output.h"
-#include "base/tls.h"
using namespace std;
namespace CVC4 {
#ifdef CVC4_DEBUG
-//CVC4_THREAD_LOCAL const char* s_debugLastException = NULL;
+//thread_local const char* s_debugLastException = NULL;
#endif /* CVC4_DEBUG */
*/
void debugAssertionFailed(const AssertionException& thisException,
const char* propagatingException) {
- static CVC4_THREAD_LOCAL bool alreadyFired = false;
+ static thread_local bool alreadyFired = false;
if(__builtin_expect( ( !std::uncaught_exception() ), true ) || alreadyFired) {
throw thisException;
namespace CVC4 {
-CVC4_THREAD_LOCAL LastExceptionBuffer* LastExceptionBuffer::s_currentBuffer = NULL;
+thread_local LastExceptionBuffer* LastExceptionBuffer::s_currentBuffer = NULL;
LastExceptionBuffer::LastExceptionBuffer() : d_contents(NULL) {}
#include <stdexcept>
#include <string>
-#include "base/tls.h"
-
namespace CVC4 {
class CVC4_PUBLIC Exception : public std::exception {
char* d_contents;
- static CVC4_THREAD_LOCAL LastExceptionBuffer* s_currentBuffer;
+ static thread_local LastExceptionBuffer* s_currentBuffer;
}; /* class LastExceptionBuffer */
}/* CVC4 namespace */
+++ /dev/null
-/********************* */
-/*! \file tls.h
- ** \verbatim
- ** Top contributors (to current version):
- ** Andres Noetzli
- ** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2018 by the authors listed in the file AUTHORS
- ** in the top-level source directory) and their institutional affiliations.
- ** All rights reserved. See the file COPYING in the top-level source
- ** directory for licensing information.\endverbatim
- **
- ** \brief Definiton of CVC4_THREAD_LOCAL
- **
- ** This header defines CVC4_THREAD_LOCAL, which should be used instead of
- ** thread_local because it is not supported by all build types (e.g. Swig).
- **/
-
-#include "cvc4_public.h"
-
-#ifndef __CVC4__BASE__TLS_H
-#define __CVC4__BASE__TLS_H
-
-#if SWIG && (!defined(SWIG_VERSION) || SWIG_VERSION < 0x030000)
-// SWIG versions older than 3.0 do not support thread_local, so just redefine
-// CVC4_THREAD_LOCAL to be empty for those versions.
-#define CVC4_THREAD_LOCAL
-#else
-#define CVC4_THREAD_LOCAL thread_local
-#endif
-
-#endif /* __CVC4__BASE__TLS_H */
# error This file should only be included when generating swig interfaces.
#endif /* SWIG */
-#if !defined(SWIG_VERSION) || SWIG_VERSION < 0x020000
-# error CVC4 bindings require swig version 2.0.0 or later, sorry.
+#if !defined(SWIG_VERSION) || SWIG_VERSION < 0x030000
+# error CVC4 bindings require swig version 3.0.0 or later, sorry.
#endif /* SWIG_VERSION */
%import "cvc4_public.h"
-%import "base/tls.h"
// swig doesn't like GCC attributes
#define __attribute__(x)
-// We safely ignore some C++11 keywords that older versions of SWIG cannot
-// handle.
-#if SWIG_VERSION < 0x030000
-%define final %enddef
-%define override %enddef
-%define noexcept %enddef
-#endif
-
%import "bindings/swig.h"
%include "stdint.i"
namespace CVC4 {
-CVC4_THREAD_LOCAL NodeManager* NodeManager::s_current = NULL;
+thread_local NodeManager* NodeManager::s_current = NULL;
namespace {
#include <string>
#include <unordered_set>
-#include "base/tls.h"
#include "expr/kind.h"
#include "expr/metakind.h"
#include "expr/node_value.h"
expr::NodeValueIDHashFunction,
expr::NodeValueIDEquality> NodeValueIDSet;
- static CVC4_THREAD_LOCAL NodeManager* s_current;
+ static thread_local NodeManager* s_current;
Options* d_options;
StatisticsRegistry* d_statisticsRegistry;
// This must come before PORTFOLIO_BUILD.
#include "cvc4autoconfig.h"
-#include "base/tls.h"
#include "base/configuration.h"
#include "base/output.h"
#include "expr/expr_iomanip.h"
namespace CVC4 {
namespace main {
/** Global options variable */
- CVC4_THREAD_LOCAL Options* pOptions;
+ thread_local Options* pOptions;
/** Full argv[0] */
const char *progPath;
# endif /* HAVE_EXT_STDIO_FILEBUF_H */
#endif /* HAVE_LIBREADLINE */
-#include "base/tls.h"
#include "base/output.h"
#include "options/language.h"
#include "options/options.h"
};/* struct StringPrefix2Less */
char* commandGenerator(const char* text, int state) {
- static CVC4_THREAD_LOCAL const std::string* rlCommand;
- static CVC4_THREAD_LOCAL set<string>::const_iterator* rlDeclaration;
+ static thread_local const std::string* rlCommand;
+ static thread_local set<string>::const_iterator* rlDeclaration;
const std::string* i = lower_bound(commandsBegin, commandsEnd, text, StringPrefix2Less());
const std::string* j = upper_bound(commandsBegin, commandsEnd, text, StringPrefix1Less());
#include <exception>
#include <string>
-#include "base/tls.h"
#include "base/exception.h"
#include "cvc4autoconfig.h"
#include "expr/expr_manager.h"
extern bool segvSpin;
/** A pointer to the options in play */
-extern CVC4_THREAD_LOCAL Options* pOptions;
+extern thread_local Options* pOptions;
/** Initialize the driver. Sets signal handlers for SIGINT and SIGSEGV.
* This can throw a CVC4::Exception.
#include "base/listener.h"
#include "base/modal_exception.h"
-#include "base/tls.h"
#include "options/argument_extender.h"
#include "options/language.h"
#include "options/option_exception.h"
options::OptionsHandler* d_handler;
/** The current Options in effect */
- static CVC4_THREAD_LOCAL Options* s_current;
+ static thread_local Options* s_current;
/** Listeners for options::forceLogicString being set. */
ListenerCollection d_forceLogicListeners;
#include <sstream>
#include <limits>
-#include "base/tls.h"
#include "base/cvc4_assert.h"
#include "base/exception.h"
#include "base/output.h"
namespace CVC4 {
-CVC4_THREAD_LOCAL Options* Options::s_current = NULL;
+thread_local Options* Options::s_current = NULL;
#include "smt/smt_engine_scope.h"
-#include "base/tls.h"
#include "base/configuration_private.h"
#include "base/cvc4_assert.h"
#include "base/output.h"
namespace CVC4 {
namespace smt {
-CVC4_THREAD_LOCAL SmtEngine* s_smtEngine_current = NULL;
+thread_local SmtEngine* s_smtEngine_current = NULL;
SmtEngine* currentSmtEngine() {
Assert(s_smtEngine_current != NULL);
#include <vector>
-#include "base/tls.h"
#include "expr/node.h"
namespace CVC4 {
class NodeVisitor {
/** For re-entry checking */
- static CVC4_THREAD_LOCAL bool s_inRun;
+ static thread_local bool s_inRun;
/**
* Guard against NodeVisitor<> being re-entrant.
};/* class NodeVisitor<> */
template <typename Visitor>
-CVC4_THREAD_LOCAL bool NodeVisitor<Visitor>::s_inRun = false;
+thread_local bool NodeVisitor<Visitor>::s_inRun = false;
}/* CVC4 namespace */
#include "theory/arith/dual_simplex.h"
#include "base/output.h"
-#include "base/tls.h"
#include "options/arith_options.h"
#include "smt/smt_statistics_registry.h"
#include "theory/arith/constraint.h"
Result::Sat DualSimplexDecisionProcedure::dualFindModel(bool exactResult){
Assert(d_conflictVariables.empty());
- static CVC4_THREAD_LOCAL unsigned int instance = 0;
+ static thread_local unsigned int instance = 0;
instance = instance + 1;
d_pivots = 0;
#include "theory/arith/fc_simplex.h"
#include "base/output.h"
-#include "base/tls.h"
#include "options/arith_options.h"
#include "smt/smt_statistics_registry.h"
#include "theory/arith/constraint.h"
Assert(d_sgnDisagreements.empty());
d_pivots = 0;
- static CVC4_THREAD_LOCAL unsigned int instance = 0;
+ static thread_local unsigned int instance = 0;
instance = instance + 1;
static const bool verbose = false;
#include <algorithm>
#include "base/output.h"
-#include "base/tls.h"
#include "options/arith_options.h"
#include "smt/smt_statistics_registry.h"
#include "theory/arith/constraint.h"
Assert(d_sgnDisagreements.empty());
d_pivots = 0;
- static CVC4_THREAD_LOCAL unsigned int instance = 0;
+ static thread_local unsigned int instance = 0;
instance = instance + 1;
static const bool verbose = false;
#include <vector>
#include "base/output.h"
-#include "base/tls.h"
#include "context/cdhashset.h"
#include "context/cdinsert_hashmap.h"
#include "context/cdlist.h"
if(Debug.isOn("paranoid:check_tableau")){ d_linEq.debugCheckTableau(); }
- static CVC4_THREAD_LOCAL unsigned callCount = 0;
+ static thread_local unsigned callCount = 0;
if(Debug.isOn("arith::presolve")) {
Debug("arith::presolve") << "TheoryArithPrivate::presolve #" << callCount << endl;
callCount = callCount + 1;
return Abc_AigMux(AigBitblaster::currentAigM(), cond, a, b);
}
-CVC4_THREAD_LOCAL Abc_Ntk_t* AigBitblaster::s_abcAigNetwork = nullptr;
+thread_local Abc_Ntk_t* AigBitblaster::s_abcAigNetwork = nullptr;
Abc_Ntk_t* AigBitblaster::currentAigNtk() {
if (!AigBitblaster::s_abcAigNetwork) {
#include "theory/bv/bitblast/bitblaster.h"
-#include "base/tls.h"
-
class Abc_Obj_t_;
typedef Abc_Obj_t_ Abc_Obj_t;
typedef std::unordered_map<TNode, Abc_Obj_t*, TNodeHashFunction> TNodeAigMap;
typedef std::unordered_map<Node, Abc_Obj_t*, NodeHashFunction> NodeAigMap;
- static CVC4_THREAD_LOCAL Abc_Ntk_t* s_abcAigNetwork;
+ static thread_local Abc_Ntk_t* s_abcAigNetwork;
std::unique_ptr<context::Context> d_nullContext;
std::unique_ptr<prop::SatSolver> d_satSolver;
TNodeAigMap d_aigCache;
using namespace CVC4::theory::bv;
-// CVC4_THREAD_LOCAL AllRewriteRules* TheoryBVRewriter::s_allRules = NULL;
-// CVC4_THREAD_LOCAL TimerStat* TheoryBVRewriter::d_rewriteTimer = NULL;
+// thread_local AllRewriteRules* TheoryBVRewriter::s_allRules = NULL;
+// thread_local TimerStat* TheoryBVRewriter::d_rewriteTimer = NULL;
RewriteFunction TheoryBVRewriter::d_rewriteTable[kind::LAST_KIND];
void TheoryBVRewriter::init() {
// s_allRules = new AllRewriteRules;
}
#ifdef CVC4_ASSERTIONS
-static CVC4_THREAD_LOCAL std::unordered_set<Node, NodeHashFunction>* s_rewriteStack = NULL;
+static thread_local std::unordered_set<Node, NodeHashFunction>* s_rewriteStack = NULL;
#endif /* CVC4_ASSERTIONS */
class RewriterInitializer {
#ifndef __CVC4__UTIL__RANDOM_H
#define __CVC4__UTIL__RANDOM_H
-#include "base/tls.h"
-
namespace CVC4 {
class Random
/* Get current RNG (singleton). */
static Random& getRandom()
{
- static CVC4_THREAD_LOCAL Random s_current(0);
+ static thread_local Random s_current(0);
return s_current;
}