Skip to content

Replace the goto_check indirection by direct use of goto_check_c [blocks: #6688] #6716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/goto-instrument/accelerate/acceleration_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ void acceleration_utilst::ensure_no_overflows(scratch_programt &program)

// goto_functionst::goto_functiont fn;
// fn.body.instructions.swap(program.instructions);
// goto_check(ns, checker_options, fn);
// goto_check_c(ns, checker_options, fn);
// fn.body.instructions.swap(program.instructions);

#ifdef DEBUG
Expand Down
2 changes: 1 addition & 1 deletion src/goto-instrument/goto_instrument_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ void goto_instrument_parse_optionst::instrument_goto_program()
}

// add generic checks, if needed
goto_check(options, goto_model, ui_message_handler);
goto_check_c(options, goto_model, ui_message_handler);
transform_assertions_assumptions(options, goto_model);

// check for uninitalized local variables
Expand Down
40 changes: 2 additions & 38 deletions src/goto-programs/goto_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,9 @@ Author: Daniel Kroening, [email protected]
#include "goto_check.h"

#include <util/options.h>
#include <util/symbol.h>

#include <goto-programs/goto_model.h>
#include <goto-programs/remove_skip.h>

#include <ansi-c/goto_check_c.h>

void goto_check(
const irep_idt &function_identifier,
goto_functionst::goto_functiont &goto_function,
const namespacet &ns,
const optionst &options,
message_handlert &message_handler)
{
const auto &function_symbol = ns.lookup(function_identifier);

if(function_symbol.mode == ID_C)
{
goto_check_c(
function_identifier, goto_function, ns, options, message_handler);
}
}

void goto_check(
const namespacet &ns,
const optionst &options,
goto_functionst &goto_functions,
message_handlert &message_handler)
{
goto_check_c(ns, options, goto_functions, message_handler);
}

void goto_check(
const optionst &options,
goto_modelt &goto_model,
message_handlert &message_handler)
{
goto_check_c(options, goto_model, message_handler);
}
#include "goto_model.h"
#include "remove_skip.h"

static void transform_assertions_assumptions(
goto_programt &goto_program,
Expand Down
20 changes: 1 addition & 19 deletions src/goto-programs/goto_check.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,9 @@ Author: Daniel Kroening, [email protected]
#ifndef CPROVER_GOTO_PROGRAMS_GOTO_CHECK_H
#define CPROVER_GOTO_PROGRAMS_GOTO_CHECK_H

#include "goto_functions.h"

class goto_modelt;
class namespacet;
class goto_programt;
class optionst;
class message_handlert;

void goto_check(
const namespacet &,
const optionst &,
goto_functionst &,
message_handlert &);

void goto_check(
const irep_idt &function_identifier,
goto_functionst::goto_functiont &,
const namespacet &,
const optionst &,
message_handlert &);

void goto_check(const optionst &, goto_modelt &, message_handlert &);

/// Handle the options "assertions", "built-in-assertions", "assumptions" to
/// remove assertions and assumptions in \p goto_model when these are set to
Expand Down
4 changes: 3 additions & 1 deletion src/goto-programs/process_goto_program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Author: Martin Brain, [email protected]
#include <goto-programs/string_abstraction.h>
#include <goto-programs/string_instrumentation.h>

#include <ansi-c/goto_check_c.h>

#include "goto_check.h"

bool process_goto_program(
Expand Down Expand Up @@ -73,7 +75,7 @@ bool process_goto_program(

// add generic checks
log.status() << "Generic Property Instrumentation" << messaget::eom;
goto_check(options, goto_model, log.get_message_handler());
goto_check_c(options, goto_model, log.get_message_handler());
transform_assertions_assumptions(options, goto_model);

// checks don't know about adjusted float expressions
Expand Down