Skip to content

goto_inlinet isn't a messaget #5594

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
Nov 16, 2020
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
50 changes: 27 additions & 23 deletions src/goto-programs/goto_inline_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ void goto_inlinet::parameter_assignments(
// if you run out of actual arguments there was a mismatch
if(it1==arguments.end())
{
warning().source_location=source_location;
warning() << "call to '" << function_name << "': "
<< "not enough arguments, "
<< "inserting non-deterministic value" << eom;
log.warning().source_location = source_location;
log.warning() << "call to '" << function_name << "': "
<< "not enough arguments, "
<< "inserting non-deterministic value" << messaget::eom;

actual = side_effect_expr_nondett(parameter_type, source_location);
}
Expand Down Expand Up @@ -171,9 +171,9 @@ void goto_inlinet::replace_return(
{
if(!code_return.has_return_value())
{
warning().source_location=it->code.find_source_location();
warning() << "return expects one operand!\n"
<< it->code.pretty() << eom;
log.warning().source_location = it->code.find_source_location();
log.warning() << "return expects one operand!\n"
<< it->code.pretty() << messaget::eom;
continue;
}

Expand Down Expand Up @@ -355,9 +355,9 @@ void goto_inlinet::expand_function_call(
{
// it's recursive.
// Uh. Buh. Give up.
warning().source_location=function.find_source_location();
warning() << "recursion is ignored on call to '" << identifier << "'"
<< eom;
log.warning().source_location = function.find_source_location();
log.warning() << "recursion is ignored on call to '" << identifier << "'"
<< messaget::eom;

if(force_full)
target->turn_into_skip();
Expand All @@ -370,8 +370,9 @@ void goto_inlinet::expand_function_call(

if(f_it==goto_functions.function_map.end())
{
warning().source_location=function.find_source_location();
warning() << "missing function '" << identifier << "' is ignored" << eom;
log.warning().source_location = function.find_source_location();
log.warning() << "missing function '" << identifier << "' is ignored"
<< messaget::eom;

if(force_full)
target->turn_into_skip();
Expand Down Expand Up @@ -401,15 +402,17 @@ void goto_inlinet::expand_function_call(
function,
arguments);

progress() << "Inserting " << identifier << " into caller" << eom;
progress() << "Number of instructions: "
<< cached.body.instructions.size() << eom;
log.progress() << "Inserting " << identifier << " into caller"
<< messaget::eom;
log.progress() << "Number of instructions: "
<< cached.body.instructions.size() << messaget::eom;

if(!caching)
{
progress() << "Removing " << identifier << " from cache" << eom;
progress() << "Number of instructions: "
<< cached.body.instructions.size() << eom;
log.progress() << "Removing " << identifier << " from cache"
<< messaget::eom;
log.progress() << "Number of instructions: "
<< cached.body.instructions.size() << messaget::eom;

inline_log.cleanup(cached.body);
cache.erase(identifier);
Expand Down Expand Up @@ -438,8 +441,9 @@ void goto_inlinet::expand_function_call(
{
if(no_body_set.insert(identifier).second) // newly inserted
{
warning().source_location = function.find_source_location();
warning() << "no body for function '" << identifier << "'" << eom;
log.warning().source_location = function.find_source_location();
log.warning() << "no body for function '" << identifier << "'"
<< messaget::eom;
}
}
}
Expand Down Expand Up @@ -567,9 +571,9 @@ const goto_inlinet::goto_functiont &goto_inlinet::goto_inline_transitive(
DATA_INVARIANT(
cached.body.empty(), "body of new function in cache must be empty");

progress() << "Creating copy of " << identifier << eom;
progress() << "Number of instructions: "
<< goto_function.body.instructions.size() << eom;
log.progress() << "Creating copy of " << identifier << messaget::eom;
log.progress() << "Number of instructions: "
<< goto_function.body.instructions.size() << messaget::eom;

cached.copy_from(goto_function); // location numbers not changed
inline_log.copy_from(goto_function.body, cached.body);
Expand Down
15 changes: 8 additions & 7 deletions src/goto-programs/goto_inline_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ Author: Daniel Kroening, [email protected]

#include "goto_functions.h"

class goto_inlinet:public messaget
class goto_inlinet
{
public:
goto_inlinet(
goto_functionst &goto_functions,
const namespacet &ns,
message_handlert &message_handler,
bool adjust_function,
bool caching=true):
messaget(message_handler),
goto_functions(goto_functions),
ns(ns),
adjust_function(adjust_function),
caching(caching)
bool caching = true)
: log(message_handler),
goto_functions(goto_functions),
ns(ns),
adjust_function(adjust_function),
caching(caching)
{
}

Expand Down Expand Up @@ -122,6 +122,7 @@ class goto_inlinet:public messaget
};

protected:
messaget log;
goto_functionst &goto_functions;
const namespacet &ns;

Expand Down