More work towards removing main
authorBrian Demsky <briandemsky@plrg-dock.ics.uci.edu>
Fri, 6 Dec 2019 23:13:40 +0000 (15:13 -0800)
committerBrian Demsky <briandemsky@plrg-dock.ics.uci.edu>
Fri, 6 Dec 2019 23:13:40 +0000 (15:13 -0800)
main.cc
model.cc
model.h

diff --git a/main.cc b/main.cc
index f218b3e698ad3d6408b8289756a269860ec833c8..9ed1bc6cd35de7bef9ecfadc538ec1854f825822 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -55,7 +55,7 @@ static void print_usage(struct model_params *params)
                "-x, --maxexec=NUM           Maximum number of executions.\n"
                "                            Default: %u\n"
                "                            -o help for a list of options\n"
-               "-n                          No fork\n\n"
+               "-n                          No fork\n\n",
                params->verbose,
                params->uninitvalue,
                params->maxexecutions);
@@ -155,8 +155,7 @@ void parse_options(struct model_params *params) {
                print_usage(params);
 }
 
-static void install_trace_analyses(ModelExecution *execution)
-{
+void install_trace_analyses(ModelExecution *execution) {
        ModelVector<TraceAnalysis *> * installedanalysis=getInstalledTraceAnalysis();
        for(unsigned int i=0;i<installedanalysis->size();i++) {
                TraceAnalysis * ta=(*installedanalysis)[i];
index 69df0d226023ec9b212e55e5276c2993c2d001cb..80e23578f5bbb76292d562c3db637efd4db04621 100644 (file)
--- a/model.cc
+++ b/model.cc
 #include "history.h"
 #include "bugmessage.h"
 #include "params.h"
+#include "plugins.h"
 
 ModelChecker *model = NULL;
 
+void placeholder(void *) {
+       ASSERT(0);
+}
+
 /** @brief Constructor */
 ModelChecker::ModelChecker() :
        /* Initialize default scheduler */
@@ -33,12 +38,12 @@ ModelChecker::ModelChecker() :
        trace_analyses(),
        inspect_plugin(NULL)
 {
-       printf("C11Tester\n"
-              "Copyright (c) 2013 and 2019 Regents of the University of California. All rights reserved.\n"
-              "Distributed under the GPLv2\n"
-              "Written by Weiyu Luo, Brian Norris, and Brian Demsky\n\n");
+       printf("C11Tester\n"
+                                "Copyright (c) 2013 and 2019 Regents of the University of California. All rights reserved.\n"
+                                "Distributed under the GPLv2\n"
+                                "Written by Weiyu Luo, Brian Norris, and Brian Demsky\n\n");
        memset(&stats,0,sizeof(struct execution_stats));
-       init_thread = new Thread(execution->get_next_id(), (thrd_t *) model_malloc(sizeof(thrd_t)), NULL, NULL, NULL);
+       init_thread = new Thread(execution->get_next_id(), (thrd_t *) model_malloc(sizeof(thrd_t)), &placeholder, NULL, NULL);
 #ifdef TLS
        init_thread->setTLS((char *)get_tls_addr());
 #endif
diff --git a/model.h b/model.h
index 354ed791dc103e01cf544e9e9bc7cf5a19fb2945..d4b11d5b95d3fc677cc079fce801f6de2cfc526d 100644 (file)
--- a/model.h
+++ b/model.h
@@ -109,4 +109,6 @@ private:
 
 extern ModelChecker *model;
 void parse_options(struct model_params *params);
+void install_trace_analyses(ModelExecution *execution);
+
 #endif /* __MODEL_H__ */