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 f218b3e..9ed1bc6 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 69df0d2..80e2357 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 354ed79..d4b11d5 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__ */