From d344234d056e1cd9f50cfc611151879381c6124d Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Thu, 31 Aug 2017 17:39:16 -0700 Subject: [PATCH] Replace CVC4_THREADLOCAL in interactive_shell (#1065) Commit 546d795470ca7c30fc62fe9b6c7b8e5838e1eed4 caused our nightly builds to fail because it did not replace CVC4_THREADLOCAL with CVC4_THREAD_LOCAL in interactive_shell. This commit fixes the issue and adds readline to Travis, s.t. readline related code gets compiled as part of our CI tests. --- .travis.yml | 7 ++++--- src/main/interactive_shell.cpp | 6 +++--- src/theory/bv/theory_bv_rewriter.cpp | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index a2982000d..58d7e6ac6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,9 @@ env: - secure: "fRfdzYwV10VeW5tVSvy5qpR8ZlkXepR7XWzCulzlHs9SRI2YY20BpzWRjyMBiGu2t7IeJKT7qdjq/CJOQEM8WS76ON7QJ1iymKaRDewDs3OhyPJ71fsFKEGgLky9blk7I9qZh23hnRVECj1oJAVry9IK04bc2zyIEjUYpjRkUAQ=" - TEST_GROUPS=2 matrix: - - TRAVIS_CVC4=yes TRAVIS_CVC4_CHECK_PORTFOLIO=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_JAVA_API_TEST=yes TRAVIS_CVC4_CONFIG='production --enable-language-bindings=java,c --with-lfsc --with-portfolio' - - TRAVIS_CVC4=yes TRAVIS_CVC4_CHECK_PORTFOLIO=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_JAVA_API_TEST=yes TRAVIS_CVC4_CONFIG='debug --enable-language-bindings=java,c --with-lfsc --with-portfolio' TEST_GROUP=0 - - TRAVIS_CVC4=yes TRAVIS_CVC4_CHECK_PORTFOLIO=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_CONFIG='debug --enable-language-bindings=java,c --with-lfsc --with-portfolio' TEST_GROUP=1 + - TRAVIS_CVC4=yes TRAVIS_CVC4_CHECK_PORTFOLIO=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_JAVA_API_TEST=yes TRAVIS_CVC4_CONFIG='production --enable-language-bindings=java,c --with-lfsc --with-portfolio --enable-gpl' + - TRAVIS_CVC4=yes TRAVIS_CVC4_CHECK_PORTFOLIO=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_JAVA_API_TEST=yes TRAVIS_CVC4_CONFIG='debug --enable-language-bindings=java,c --with-lfsc --with-portfolio --enable-gpl' TEST_GROUP=0 + - TRAVIS_CVC4=yes TRAVIS_CVC4_CHECK_PORTFOLIO=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_CONFIG='debug --enable-language-bindings=java,c --with-lfsc --with-portfolio --enable-gpl' TEST_GROUP=1 - TRAVIS_CVC4=yes TRAVIS_CVC4_CONFIG='--disable-proof' - TRAVIS_CVC4=yes TRAVIS_CVC4_DISTCHECK=yes TRAVIS_CVC4_CONFIG='--enable-proof' addons: @@ -38,6 +38,7 @@ addons: - libantlr3c-dev - ant-optional - cxxtest + - libreadline-dev before_script: - export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 - export PATH=$PATH:$JAVA_HOME/bin diff --git a/src/main/interactive_shell.cpp b/src/main/interactive_shell.cpp index 0fa026f76..325f44769 100644 --- a/src/main/interactive_shell.cpp +++ b/src/main/interactive_shell.cpp @@ -37,7 +37,7 @@ # 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" @@ -382,8 +382,8 @@ struct StringPrefix2Less { };/* struct StringPrefix2Less */ char* commandGenerator(const char* text, int state) { - static CVC4_THREADLOCAL(const std::string*) rlCommand; - static CVC4_THREADLOCAL(set::const_iterator*) rlDeclaration; + static CVC4_THREAD_LOCAL const std::string* rlCommand; + static CVC4_THREAD_LOCAL set::const_iterator* rlDeclaration; const std::string* i = lower_bound(commandsBegin, commandsEnd, text, StringPrefix2Less()); const std::string* j = upper_bound(commandsBegin, commandsEnd, text, StringPrefix1Less()); diff --git a/src/theory/bv/theory_bv_rewriter.cpp b/src/theory/bv/theory_bv_rewriter.cpp index a96777954..f3185bc13 100644 --- a/src/theory/bv/theory_bv_rewriter.cpp +++ b/src/theory/bv/theory_bv_rewriter.cpp @@ -30,8 +30,8 @@ using namespace CVC4::theory; using namespace CVC4::theory::bv; -// CVC4_THREADLOCAL(AllRewriteRules*) TheoryBVRewriter::s_allRules = NULL; -// CVC4_THREADLOCAL(TimerStat*) TheoryBVRewriter::d_rewriteTimer = NULL; +// CVC4_THREAD_LOCAL AllRewriteRules* TheoryBVRewriter::s_allRules = NULL; +// CVC4_THREAD_LOCAL TimerStat* TheoryBVRewriter::d_rewriteTimer = NULL; RewriteFunction TheoryBVRewriter::d_rewriteTable[kind::LAST_KIND]; void TheoryBVRewriter::init() { // s_allRules = new AllRewriteRules; -- 2.30.2