We previously renamed all occurrences in goto functions, but did not
consider the initial values of symbols with static lifetime, which are
stored in the symbol table. To make this reasonably efficient, make
rename_symbolt::operator() expose the return value (and document the
methods).
To test this, include the test suite in Makefile-based test set-ups
(CMake was already done), and fix the chain.sh file.
We make apply take the expression by copy and return a transformed one.
This makes it more intuitive to use and avoid problems of the kind:
index_exprt i;
apply(ns, s, i, true);
f_of_index_expr(i);
where in the call to `f_of_index_expr`, `i` is of type `index_exprt` but may not have
`ID_index` thus breaking an invariant which we should intuitively have.
This takes us back to the behaviour prior to this series of commits, and
effectively is a to-do list to be addressed. We should either handle the cases,
or get rid of the instruction type.
There are a number of reasons why instruction types were left out of
these case statements :
1. Ignoring this instruction is generally a valid overapproximation.
2. Ignoring this instruction is a valid overapproximation for this
domain.
3. The instruction is assumed to not be present due to preceding
passes.
4. The instruction should never appear in any valid goto program.
5. The instruction is newer than the analysis code and was forgotten.
This patch tries to correctly document which of these apply.
This is now consistent with the warnings that Visual Studio would generate,
which warns about missing enum cases in switch/case even when a default: is
present.
Constructing a dstringt from a C string requires a string table lookup, while
the default constructor for a dstringt just zero-initialises an unsigned.
The use of "" requires constructing a std::string or dstringt, and then a
string comparison. empty() is just an integer comparison (both for std::string
an dstringt).
The use of "" requires constructing a std::string or dstringt, and then a string
comparison. empty() is just an integer comparison (both for std::string an
dstringt).
lipo/fat binaries only work properly for executables as it isn't possible to
build archives of fat binaries containing goto-cc sections (ranlib complains
about invalid object files); conversely, adding additional sections isn't
possible with executables, but fat binaries work fine.
There should only be a single place to hold type information, including
attributes, to ensure consistency. Future changes will remove the "type" member
of goto_functiont, making the type information stored in the symbol table the
single, authoritative source of information.
The "is inlined" information should already be consistent/redundant. This commit
makes all read accesses use the information stored in the symbol table, and also
uses a modern API for doing so.
Previously, if a JSON file contained a string in hexadecimal Unicode
representation, e.g. "\u0001", the JSON parser would discard the "\u"
part and store the string as "0001". This commit fixes this so the
resulting string is equal to "\u0001".