Skip to content

Commit 31f4a29

Browse files
author
thk123
committed
Pass the whole parameter in when generating the symbol
This allows for the symbol builder to inspect other properties of the type (e.g. is is a this parameter).
1 parent 55e1d5f commit 31f4a29

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/ansi-c/ansi_c_language.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Function: ansi_c_languaget::build_stub_parameter_symbol
138138
parameter_symbolt ansi_c_languaget::build_stub_parameter_symbol(
139139
const symbolt &function_symbol,
140140
size_t parameter_index,
141-
const typet &parameter_type)
141+
const code_typet::parametert &parameter)
142142
{
143143
irep_idt base_name="stub_ignored_arg"+i2string(parameter_index);
144144
irep_idt identifier=id2string(function_symbol.name)+"::"+id2string(base_name);
@@ -147,7 +147,7 @@ parameter_symbolt ansi_c_languaget::build_stub_parameter_symbol(
147147
parameter_symbol.base_name=base_name;
148148
parameter_symbol.mode=ID_C;
149149
parameter_symbol.name=identifier;
150-
parameter_symbol.type=parameter_type;
150+
parameter_symbol.type=parameter.type();
151151

152152
return parameter_symbol;
153153
}

src/ansi-c/ansi_c_language.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class ansi_c_languaget:public languaget
8383
virtual parameter_symbolt build_stub_parameter_symbol(
8484
const symbolt &function_symbol,
8585
size_t parameter_index,
86-
const typet &parameter_type) override;
86+
const code_typet::parametert &parameter) override;
8787

8888
ansi_c_parse_treet parse_tree;
8989
std::string parse_path;

src/util/language.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ Function: languaget::build_stub_parameter_symbol
215215
parameter_symbolt languaget::build_stub_parameter_symbol(
216216
const symbolt &function_symbol,
217217
size_t parameter_index,
218-
const typet &parameter_type)
218+
const code_typet::parametert &parameter)
219219
{
220220
error() << "language " << id()
221221
<< " doesn't implement build_stub_parameter_symbol. "
@@ -280,7 +280,7 @@ void languaget::generate_opaque_parameter_symbols(
280280
{
281281
code_typet::parametert &param=parameters[i];
282282
const parameter_symbolt &param_symbol=
283-
build_stub_parameter_symbol(function_symbol, i, param.type());
283+
build_stub_parameter_symbol(function_symbol, i, param);
284284

285285
param.set_base_name(param_symbol.base_name);
286286
param.set_identifier(param_symbol.name);

src/util/language.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Author: Daniel Kroening, [email protected]
1313
#include <iosfwd>
1414
#include <string>
1515
#include <util/symbol.h>
16+
#include <util/std_types.h>
1617

1718
#include "message.h"
1819

@@ -112,7 +113,7 @@ class languaget:public messaget
112113
virtual parameter_symbolt build_stub_parameter_symbol(
113114
const symbolt &function_symbol,
114115
size_t parameter_index,
115-
const typet &parameter_type);
116+
const code_typet::parametert &parameter);
116117
private:
117118
bool is_symbol_opaque_function(const symbolt &symbol);
118119
void generate_opaque_parameter_symbols(

0 commit comments

Comments
 (0)