From 4cdfe4a1979c6bf3f5afe7f5733fd35308710300 Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Tue, 6 Jul 2010 19:36:59 +0000 Subject: [PATCH] add Configuration::isCompetitionBuild() and some main driver fixes --- src/main/getopt.cpp | 13 +++++++------ src/main/main.cpp | 6 ++++++ src/util/configuration.cpp | 8 ++++++++ src/util/configuration.h | 2 ++ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/main/getopt.cpp b/src/main/getopt.cpp index 2b36a06d2..ed196ac45 100644 --- a/src/main/getopt.cpp +++ b/src/main/getopt.cpp @@ -258,12 +258,13 @@ throw(OptionException) { Configuration::getVersionMinor(), Configuration::getVersionRelease()); printf("\n"); - printf("debug code: %s\n", Configuration::isDebugBuild() ? "yes" : "no"); - printf("tracing : %s\n", Configuration::isTracingBuild() ? "yes" : "no"); - printf("muzzled : %s\n", Configuration::isMuzzledBuild() ? "yes" : "no"); - printf("assertions: %s\n", Configuration::isAssertionBuild() ? "yes" : "no"); - printf("coverage : %s\n", Configuration::isCoverageBuild() ? "yes" : "no"); - printf("profiling : %s\n", Configuration::isProfilingBuild() ? "yes" : "no"); + printf("debug code : %s\n", Configuration::isDebugBuild() ? "yes" : "no"); + printf("tracing : %s\n", Configuration::isTracingBuild() ? "yes" : "no"); + printf("muzzled : %s\n", Configuration::isMuzzledBuild() ? "yes" : "no"); + printf("assertions : %s\n", Configuration::isAssertionBuild() ? "yes" : "no"); + printf("coverage : %s\n", Configuration::isCoverageBuild() ? "yes" : "no"); + printf("profiling : %s\n", Configuration::isProfilingBuild() ? "yes" : "no"); + printf("competition: %s\n", Configuration::isCompetitionBuild() ? "yes" : "no"); exit(0); case '?': diff --git a/src/main/main.cpp b/src/main/main.cpp index 855bcbdde..0cf712e3b 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -182,6 +182,12 @@ int runCvc4(int argc, char* argv[]) { delete cmd; } +#ifdef CVC4_COMPETITION_MODE + // exit, don't return + // (don't want destructors to run) + exit(0); +#endif + // Get ready for tear-down exprMgr.prepareToBeDestroyed(); diff --git a/src/util/configuration.cpp b/src/util/configuration.cpp index 12908c672..0b751429b 100644 --- a/src/util/configuration.cpp +++ b/src/util/configuration.cpp @@ -73,6 +73,14 @@ bool Configuration::isProfilingBuild() { #endif /* CVC4_PROFILING */ } +bool Configuration::isCompetitionBuild() { +#ifdef CVC4_COMPETITION_MODE + return true; +#else /* CVC4_COMPETITION_MODE */ + return false; +#endif /* CVC4_COMPETITION_MODE */ +} + string Configuration::getPackageName() { return PACKAGE_NAME; } diff --git a/src/util/configuration.h b/src/util/configuration.h index 6d5ac12a1..cca9202bf 100644 --- a/src/util/configuration.h +++ b/src/util/configuration.h @@ -49,6 +49,8 @@ public: static bool isProfilingBuild(); + static bool isCompetitionBuild(); + static std::string getPackageName(); static std::string getVersionString(); -- 2.30.2