Skip to content

Commit 1b58fb7

Browse files
author
martin
committed
Create a stub for a common process_goto_program
This should not alter observable behaviour.
1 parent 441a249 commit 1b58fb7

File tree

6 files changed

+67
-0
lines changed

6 files changed

+67
-0
lines changed

src/cbmc/cbmc_parse_options.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Author: Daniel Kroening, [email protected]
5555
#include <goto-programs/link_to_library.h>
5656
#include <goto-programs/loop_ids.h>
5757
#include <goto-programs/mm_io.h>
58+
#include <goto-programs/process_goto_program.h>
5859
#include <goto-programs/read_goto_binary.h>
5960
#include <goto-programs/remove_complex.h>
6061
#include <goto-programs/remove_function_pointers.h>
@@ -912,6 +913,9 @@ bool cbmc_parse_optionst::process_goto_program(
912913
const optionst &options,
913914
messaget &log)
914915
{
916+
// Common removal of types and complex constructs
917+
::process_goto_program(goto_model, options, log);
918+
915919
// Remove inline assembler; this needs to happen before
916920
// adding the library.
917921
remove_asm(goto_model);

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Author: Daniel Kroening, [email protected]
3232
#include <goto-programs/goto_inline.h>
3333
#include <goto-programs/initialize_goto_model.h>
3434
#include <goto-programs/link_to_library.h>
35+
#include <goto-programs/process_goto_program.h>
3536
#include <goto-programs/read_goto_binary.h>
3637
#include <goto-programs/remove_complex.h>
3738
#include <goto-programs/remove_function_pointers.h>
@@ -867,6 +868,9 @@ int goto_analyzer_parse_optionst::perform_analysis(const optionst &options)
867868
bool goto_analyzer_parse_optionst::process_goto_program(
868869
const optionst &options)
869870
{
871+
// Common removal of types and complex constructs
872+
::process_goto_program(goto_model, options, log);
873+
870874
{
871875
#if 0
872876
// Remove inline assembler; this needs to happen before

src/goto-diff/goto_diff_parse_options.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Author: Peter Schrammel
3232
#include <goto-programs/link_to_library.h>
3333
#include <goto-programs/loop_ids.h>
3434
#include <goto-programs/mm_io.h>
35+
#include <goto-programs/process_goto_program.h>
3536
#include <goto-programs/read_goto_binary.h>
3637
#include <goto-programs/remove_complex.h>
3738
#include <goto-programs/remove_function_pointers.h>
@@ -314,6 +315,9 @@ bool goto_diff_parse_optionst::process_goto_program(
314315
const optionst &options,
315316
goto_modelt &goto_model)
316317
{
318+
// Common removal of types and complex constructs
319+
::process_goto_program(goto_model, options, log);
320+
317321
{
318322
// Remove inline assembler; this needs to happen before
319323
// adding the library.

src/goto-programs/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ SRC = add_malloc_may_fail_variable_initializations.cpp \
3939
parameter_assignments.cpp \
4040
pointer_arithmetic.cpp \
4141
printf_formatter.cpp \
42+
process_goto_program.cpp \
4243
read_bin_goto_object.cpp \
4344
read_goto_binary.cpp \
4445
rebuild_goto_start_function.cpp \
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*******************************************************************\
2+
3+
Module: Process a Goto Program
4+
5+
Author: Martin Brain, [email protected]
6+
7+
\*******************************************************************/
8+
9+
/// \file
10+
/// Get a Goto Program
11+
12+
#include "process_goto_program.h"
13+
14+
#include <goto-programs/goto_model.h>
15+
16+
#include <util/message.h>
17+
#include <util/options.h>
18+
19+
bool process_goto_program(
20+
goto_modelt &goto_model,
21+
const optionst &options,
22+
messaget &log)
23+
{
24+
return false;
25+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*******************************************************************\
2+
3+
Module: Process a Goto Program
4+
5+
Author: Martin Brain, [email protected]
6+
7+
\*******************************************************************/
8+
9+
/// \file
10+
/// Common processing and simplification of goto_programts.
11+
/// This includes linking libraries and removing a number of
12+
/// more complex types (vectors, complex, etc.) and constructs
13+
/// (returns, function pointers, etc.).
14+
/// This is can be used after initialize_goto_model but before
15+
/// analysis. It is not madatory but is used by most tools.
16+
17+
#ifndef CPROVER_GOTO_PROGRAMS_PROCESS_GOTO_PROGRAM_H
18+
#define CPROVER_GOTO_PROGRAMS_PROCESS_GOTO_PROGRAM_H
19+
20+
class goto_modelt;
21+
class optionst;
22+
class messaget;
23+
24+
bool process_goto_program(
25+
goto_modelt &goto_model,
26+
const optionst &options,
27+
messaget &log);
28+
29+
#endif // CPROVER_GOTO_PROGRAMS_PROCESS_GOTO_PROGRAM_H

0 commit comments

Comments
 (0)