Skip to content

Commit 93fcb68

Browse files
author
Joel Allred
authored
Merge pull request #3735 from tautschnig/move-remove_asm
Move remove_asm.{h,cpp} to assembler/
2 parents c2e3503 + 1286fb6 commit 93fcb68

16 files changed

+37
-31
lines changed

jbmc/src/jbmc/jbmc_parse_options.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ Author: Daniel Kroening, [email protected]
3737
#include <goto-programs/loop_ids.h>
3838
#include <goto-programs/remove_virtual_functions.h>
3939
#include <goto-programs/remove_returns.h>
40-
#include <goto-programs/remove_asm.h>
4140
#include <goto-programs/remove_unused_functions.h>
4241
#include <goto-programs/remove_skip.h>
4342
#include <goto-programs/set_properties.h>

jbmc/unit/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ BMC_DEPS =$(CPROVER_DIR)/src/cbmc/all_properties$(OBJEXT) \
8686
$(CPROVER_DIR)/src/cbmc/bmc$(OBJEXT) \
8787
$(CPROVER_DIR)/src/cbmc/bmc_cover$(OBJEXT) \
8888
$(CPROVER_DIR)/src/cbmc/cbmc_languages$(OBJEXT) \
89-
$(CPROVER_DIR)/src/cbmc/cbmc_parse_options$(OBJEXT) \
9089
$(CPROVER_DIR)/src/cbmc/counterexample_beautification$(OBJEXT) \
9190
$(CPROVER_DIR)/src/cbmc/fault_localization$(OBJEXT) \
9291
$(CPROVER_DIR)/src/cbmc/xml_interface$(OBJEXT) \
@@ -132,7 +131,6 @@ CPROVER_LIBS =../src/java_bytecode/java_bytecode$(LIBEXT) \
132131
$(CPROVER_DIR)/src/pointer-analysis/pointer-analysis$(LIBEXT) \
133132
$(CPROVER_DIR)/src/langapi/langapi$(LIBEXT) \
134133
$(CPROVER_DIR)/src/xmllang/xmllang$(LIBEXT) \
135-
$(CPROVER_DIR)/src/assembler/assembler$(LIBEXT) \
136134
$(CPROVER_DIR)/src/analyses/analyses$(LIBEXT) \
137135
$(CPROVER_DIR)/src/solvers/solvers$(LIBEXT) \
138136
$(BMC_DEPS) \

src/assembler/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
SRC = assembler_lex.yy.cpp \
22
assembler_parser.cpp \
3+
remove_asm.cpp \
34
# Empty last line
45
INCLUDES= -I ..
56

src/assembler/module_dependencies.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
assembler
2+
goto-programs
23
util

src/goto-programs/remove_asm.cpp renamed to src/assembler/remove_asm.cpp

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Date: December 2014
1818
#include <util/c_types.h>
1919
#include <util/string_constant.h>
2020

21-
#include <assembler/assembler_parser.h>
21+
#include <goto-programs/goto_model.h>
22+
#include <goto-programs/remove_skip.h>
2223

23-
#include "goto_model.h"
24-
#include "remove_skip.h"
24+
#include "assembler_parser.h"
2525

2626
class remove_asmt
2727
{
@@ -74,17 +74,16 @@ void remove_asmt::gcc_asm_function_call(
7474
const code_asmt &code,
7575
goto_programt &dest)
7676
{
77-
irep_idt function_identifier=function_base_name;
77+
irep_idt function_identifier = function_base_name;
7878

7979
code_function_callt::argumentst arguments;
8080

81-
const typet void_pointer=
82-
pointer_type(void_typet());
81+
const typet void_pointer = pointer_type(void_typet());
8382

8483
// outputs
8584
forall_operands(it, code.op1())
8685
{
87-
if(it->operands().size()==2)
86+
if(it->operands().size() == 2)
8887
{
8988
arguments.push_back(
9089
typecast_exprt(address_of_exprt(it->op1()), void_pointer));
@@ -94,7 +93,7 @@ void remove_asmt::gcc_asm_function_call(
9493
// inputs
9594
forall_operands(it, code.op2())
9695
{
97-
if(it->operands().size()==2)
96+
if(it->operands().size() == 2)
9897
{
9998
arguments.push_back(
10099
typecast_exprt(address_of_exprt(it->op1()), void_pointer));
@@ -108,19 +107,19 @@ void remove_asmt::gcc_asm_function_call(
108107

109108
code_function_callt function_call(std::move(fkt), std::move(arguments));
110109

111-
goto_programt::targett call=dest.add_instruction(FUNCTION_CALL);
112-
call->code=function_call;
113-
call->source_location=code.source_location();
110+
goto_programt::targett call = dest.add_instruction(FUNCTION_CALL);
111+
call->code = function_call;
112+
call->source_location = code.source_location();
114113

115114
// do we have it?
116115
if(!symbol_table.has_symbol(function_identifier))
117116
{
118117
symbolt symbol;
119118

120-
symbol.name=function_identifier;
121-
symbol.type=fkt_type;
122-
symbol.base_name=function_base_name;
123-
symbol.value=nil_exprt();
119+
symbol.name = function_identifier;
120+
symbol.type = fkt_type;
121+
symbol.base_name = function_base_name;
122+
symbol.value = nil_exprt();
124123
symbol.mode = ID_C;
125124

126125
symbol_table.add(symbol);
@@ -195,11 +194,11 @@ void remove_asmt::process_instruction(
195194
goto_programt::instructiont &instruction,
196195
goto_programt &dest)
197196
{
198-
const code_asmt &code=to_code_asm(instruction.code);
197+
const code_asmt &code = to_code_asm(instruction.code);
199198

200-
const irep_idt &flavor=code.get_flavor();
199+
const irep_idt &flavor = code.get_flavor();
201200

202-
if(flavor==ID_gcc)
201+
if(flavor == ID_gcc)
203202
process_instruction_gcc(code, dest);
204203
else if(flavor == ID_msc)
205204
process_instruction_msc(code, dest);
@@ -497,7 +496,7 @@ void remove_asmt::process_function(
497496
for(auto &instruction : tmp_dest.instructions)
498497
instruction.function = it->function;
499498

500-
goto_programt::targett next=it;
499+
goto_programt::targett next = it;
501500
next++;
502501

503502
goto_function.body.destructive_insert(next, tmp_dest);

src/goto-programs/remove_asm.h renamed to src/assembler/remove_asm.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ Date: December 2014
4949
/// Unrecognised assembly instructions are ignored (i.e., they are simply
5050
/// removed from the goto program).
5151

52-
#ifndef CPROVER_GOTO_PROGRAMS_REMOVE_ASM_H
53-
#define CPROVER_GOTO_PROGRAMS_REMOVE_ASM_H
52+
#ifndef CPROVER_ASSEMBLER_REMOVE_ASM_H
53+
#define CPROVER_ASSEMBLER_REMOVE_ASM_H
5454

5555
#include <goto-programs/goto_functions.h>
5656

@@ -61,4 +61,4 @@ void remove_asm(goto_functionst &, symbol_tablet &);
6161

6262
void remove_asm(goto_modelt &);
6363

64-
#endif // CPROVER_GOTO_PROGRAMS_REMOVE_ASM_H
64+
#endif // CPROVER_ASSEMBLER_REMOVE_ASM_H

src/cbmc/cbmc_parse_options.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Author: Daniel Kroening, [email protected]
2828
#include <ansi-c/c_preprocess.h>
2929
#include <ansi-c/cprover_library.h>
3030

31+
#include <assembler/remove_asm.h>
32+
3133
#include <cpp/cprover_library.h>
3234

3335
#include <goto-checker/all_properties_verifier.h>
@@ -46,7 +48,6 @@ Author: Daniel Kroening, [email protected]
4648
#include <goto-programs/remove_returns.h>
4749
#include <goto-programs/remove_vector.h>
4850
#include <goto-programs/remove_complex.h>
49-
#include <goto-programs/remove_asm.h>
5051
#include <goto-programs/remove_unused_functions.h>
5152
#include <goto-programs/remove_skip.h>
5253
#include <goto-programs/rewrite_union.h>

src/cbmc/module_dependencies.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
analyses
22
ansi-c
3+
assembler
34
cpp
45
goto-checker
56
goto-instrument

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Author: Daniel Kroening, [email protected]
1919
#include <ansi-c/ansi_c_language.h>
2020
#include <ansi-c/cprover_library.h>
2121

22+
#include <assembler/remove_asm.h>
23+
2224
#include <cpp/cpp_language.h>
2325
#include <cpp/cprover_library.h>
2426

@@ -30,7 +32,6 @@ Author: Daniel Kroening, [email protected]
3032
#include <goto-programs/initialize_goto_model.h>
3133
#include <goto-programs/link_to_library.h>
3234
#include <goto-programs/read_goto_binary.h>
33-
#include <goto-programs/remove_asm.h>
3435
#include <goto-programs/remove_complex.h>
3536
#include <goto-programs/remove_function_pointers.h>
3637
#include <goto-programs/remove_returns.h>

src/goto-analyzer/module_dependencies.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ansi-c
22
analyses
3+
assembler
34
cpp
45
goto-analyzer
56
goto-programs

src/goto-diff/goto_diff_parse_options.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Author: Peter Schrammel
3333
#include <goto-programs/loop_ids.h>
3434
#include <goto-programs/mm_io.h>
3535
#include <goto-programs/read_goto_binary.h>
36-
#include <goto-programs/remove_asm.h>
3736
#include <goto-programs/remove_complex.h>
3837
#include <goto-programs/remove_function_pointers.h>
3938
#include <goto-programs/remove_returns.h>
@@ -54,6 +53,9 @@ Author: Peter Schrammel
5453
#include <langapi/mode.h>
5554

5655
#include <ansi-c/cprover_library.h>
56+
57+
#include <assembler/remove_asm.h>
58+
5759
#include <cpp/cprover_library.h>
5860

5961
#include "goto_diff.h"

src/goto-diff/module_dependencies.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
analyses
22
ansi-c
3+
assembler
34
cpp
45
goto-diff
56
goto-instrument

src/goto-instrument/goto_instrument_parse_options.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ Author: Daniel Kroening, [email protected]
3939
#include <goto-programs/loop_ids.h>
4040
#include <goto-programs/link_to_library.h>
4141
#include <goto-programs/remove_returns.h>
42-
#include <goto-programs/remove_asm.h>
4342
#include <goto-programs/remove_unused_functions.h>
4443
#include <goto-programs/parameter_assignments.h>
4544
#include <goto-programs/slice_global_inits.h>
@@ -67,6 +66,9 @@ Author: Daniel Kroening, [email protected]
6766
#include <ansi-c/ansi_c_language.h>
6867
#include <ansi-c/c_object_factory_parameters.h>
6968
#include <ansi-c/cprover_library.h>
69+
70+
#include <assembler/remove_asm.h>
71+
7072
#include <cpp/cprover_library.h>
7173

7274
#include "accelerate/accelerate.h"

src/goto-instrument/module_dependencies.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
accelerate
22
analyses
33
ansi-c
4+
assembler
45
cpp
56
goto-instrument
67
goto-programs

src/goto-programs/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ SRC = adjust_float_expressions.cpp \
3939
read_bin_goto_object.cpp \
4040
read_goto_binary.cpp \
4141
rebuild_goto_start_function.cpp \
42-
remove_asm.cpp \
4342
remove_calls_no_body.cpp \
4443
remove_complex.cpp \
4544
remove_const_function_pointers.cpp \

src/goto-programs/module_dependencies.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
analyses # dubious - concerns call_graph and does_remove_const
2-
assembler # should go away
32
goto-programs
43
goto-symex # dubious - spurious inclusion of symex_target_equation in graphml_witness
54
json

0 commit comments

Comments
 (0)