From: Brian Demsky Date: Fri, 6 Dec 2019 23:13:40 +0000 (-0800) Subject: More work towards removing main X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=6fca9fa10da82852db32d997e78563bd8f3a7adc More work towards removing main --- diff --git a/main.cc b/main.cc index f218b3e6..9ed1bc6c 100644 --- 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 * installedanalysis=getInstalledTraceAnalysis(); for(unsigned int i=0;isize();i++) { TraceAnalysis * ta=(*installedanalysis)[i]; diff --git a/model.cc b/model.cc index 69df0d22..80e23578 100644 --- a/model.cc +++ b/model.cc @@ -18,9 +18,14 @@ #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 354ed791..d4b11d5b 100644 --- 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__ */