Skip to content

Commit cc4ab19

Browse files
authored
Merge pull request #5800 from tautschnig/array-ssa
Array-element sensitive SSA: avoid string-to-integer-to-string
2 parents 7491978 + 4cda833 commit cc4ab19

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

scripts/expected_doxygen_warnings.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ warning: Include graph for 'cbmc_parse_options.cpp' not generated, too many node
8383
warning: Include graph for 'goto_instrument_parse_options.cpp' not generated, too many nodes (97), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
8484
warning: Included by graph for 'goto_functions.h' not generated, too many nodes (66), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
8585
warning: Included by graph for 'goto_model.h' not generated, too many nodes (109), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
86-
warning: Included by graph for 'arith_tools.h' not generated, too many nodes (183), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
86+
warning: Included by graph for 'arith_tools.h' not generated, too many nodes (182), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
8787
warning: Included by graph for 'c_types.h' not generated, too many nodes (111), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
8888
warning: Included by graph for 'config.h' not generated, too many nodes (85), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.
8989
warning: Included by graph for 'exception_utils.h' not generated, too many nodes (61), threshold is 60. Consider increasing DOT_GRAPH_MAX_NODES.

src/util/ssa_expr.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Author: Daniel Kroening, kroening@kroening.com
1010

1111
#include <sstream>
1212

13-
#include "arith_tools.h"
1413
#include "pointer_expr.h"
1514

1615
/// If \p expr is:
@@ -29,8 +28,7 @@ initialize_ssa_identifier(std::ostream &os, const exprt &expr)
2928
}
3029
if(auto index = expr_try_dynamic_cast<index_exprt>(expr))
3130
{
32-
const auto idx =
33-
numeric_cast_v<mp_integer>(to_constant_expr(index->index()));
31+
const irep_idt &idx = to_constant_expr(index->index()).get_value();
3432
return initialize_ssa_identifier(os, index->array()) << "[[" << idx << "]]";
3533
}
3634
if(auto symbol = expr_try_dynamic_cast<symbol_exprt>(expr))
@@ -77,8 +75,7 @@ static void build_ssa_identifier_rec(
7775

7876
build_ssa_identifier_rec(index.array(), l0, l1, l2, os, l1_object_os);
7977

80-
const mp_integer idx =
81-
numeric_cast_v<mp_integer>(to_constant_expr(index.index()));
78+
const irep_idt &idx = to_constant_expr(index.index()).get_value();
8279
os << "[[" << idx << "]]";
8380
l1_object_os << "[[" << idx << "]]";
8481
}

0 commit comments

Comments
 (0)