Skip to content
Merged
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
44 changes: 21 additions & 23 deletions src/goto-cc/linker_script_merge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,13 @@
replacement_predicates(
{replacement_predicatet(
"address of array's first member",
[](const exprt &expr) -> const symbol_exprt & {
[](const exprt &expr) -> const symbol_exprt &

Check warning on line 137 in src/goto-cc/linker_script_merge.cpp

View check run for this annotation

Codecov / codecov/patch

src/goto-cc/linker_script_merge.cpp#L137

Added line #L137 was not covered by tests
{
return to_symbol_expr(
to_index_expr(to_address_of_expr(expr).object()).index());
to_index_expr(to_address_of_expr(expr).object()).array());

Check warning on line 140 in src/goto-cc/linker_script_merge.cpp

View check run for this annotation

Codecov / codecov/patch

src/goto-cc/linker_script_merge.cpp#L140

Added line #L140 was not covered by tests
},
[](const exprt &expr) {
[](const exprt &expr)
{
return expr.id() == ID_address_of &&
expr.type().id() == ID_pointer &&

Expand All @@ -164,10 +166,10 @@
}),
replacement_predicatet(
"address of array",
[](const exprt &expr) -> const symbol_exprt & {
return to_symbol_expr(to_address_of_expr(expr).object());
},
[](const exprt &expr) {
[](const exprt &expr) -> const symbol_exprt &
{ return to_symbol_expr(to_address_of_expr(expr).object()); },

Check warning on line 170 in src/goto-cc/linker_script_merge.cpp

View check run for this annotation

Codecov / codecov/patch

src/goto-cc/linker_script_merge.cpp#L169-L170

Added lines #L169 - L170 were not covered by tests
[](const exprt &expr)
{
return expr.id() == ID_address_of &&
expr.type().id() == ID_pointer &&

Expand All @@ -176,10 +178,10 @@
}),
replacement_predicatet(
"address of struct",
[](const exprt &expr) -> const symbol_exprt & {
return to_symbol_expr(to_address_of_expr(expr).object());
},
[](const exprt &expr) {
[](const exprt &expr) -> const symbol_exprt &
{ return to_symbol_expr(to_address_of_expr(expr).object()); },

Check warning on line 182 in src/goto-cc/linker_script_merge.cpp

View check run for this annotation

Codecov / codecov/patch

src/goto-cc/linker_script_merge.cpp#L181-L182

Added lines #L181 - L182 were not covered by tests
[](const exprt &expr)
{
return expr.id() == ID_address_of &&
expr.type().id() == ID_pointer &&

Expand All @@ -190,20 +192,16 @@
}),
replacement_predicatet(
"array variable",
[](const exprt &expr) -> const symbol_exprt & {
return to_symbol_expr(expr);
},
[](const exprt &expr) {
return expr.id() == ID_symbol && expr.type().id() == ID_array;
}),
[](const exprt &expr) -> const symbol_exprt &
{ return to_symbol_expr(expr); },
[](const exprt &expr)
{ return expr.id() == ID_symbol && expr.type().id() == ID_array; }),
replacement_predicatet(
"pointer (does not need pointerizing)",
[](const exprt &expr) -> const symbol_exprt & {
return to_symbol_expr(expr);
},
[](const exprt &expr) {
return expr.id() == ID_symbol && expr.type().id() == ID_pointer;
})})
[](const exprt &expr) -> const symbol_exprt &
{ return to_symbol_expr(expr); },
[](const exprt &expr)
{ return expr.id() == ID_symbol && expr.type().id() == ID_pointer; })})
{}

int linker_script_merget::pointerize_linker_defined_symbols(
Expand Down
Loading