For use in a downstream repository. This is used to indicate whether a
method was synthesized by the java compiler, as opposed to being a
method which has corresponding user written java code.
Without the functions added by this commit, the only way to access the
owner of a symbol for static fields and java methods is through
`symbol.type.get(ID_C_class)`. When this technique is used by downstream
repositories, they are vulnerable to being broken by upstream changes to
how this information is stored in JBMC. The intension of this commit is
that the two new functions added will be the standard interface to this
symbol -> owner link. This means that future changes to how this
information is stored can be made without breaking downstream
repositories by changing these two functions.
Previously it didn't load code attributes when skip_instructions was set
Now this flag just skips the actual instructions and the exceptions table
This means it will have the local variable table, which will allow us to retrieve parameter names
Updated unit test to check for this
This is follow-up from a discussion on PR #3998, and a comment by
@tautschnig.
This function always fails, with an exception, when given anything but a
constant_exprt.
This change means that the caller must do the type conversion. The benefit
is to make the caller more aware of the requirement that this must be a
constant, and to make the caller handle the error appropriately (with an
user-friendly error message) in case this is not possible.
The disadvantage is additional code at the call site.
Previously these relied on base_type_eq to hide differently-decorated tags; now they explicitly
just check the tag name, rather than relying on base_type_eq, which will soon go away anyway, to
hide generic qualifiers and/or array element types.
Previously if asked to populate a pointer with tagged type (e.g. "Object *") then it would
allocate a "struct Object { ... }", i.e. the struct_typet rather than the struct_tag_typet.
This verifies that it now retains tag types.
Previously it would follow types as it went, resulting in generated objects with raw struct types.
Now it only follows types locally for reference, and passes the tagged types to subroutines.
This means that a pointer is once again just a pointer, and can be removed and reapplied
without risking losing information. On the other hand tags now carry decorations more often
(they already played this role when expressing a superclass, which is implemented as a nested
struct), so `ns.follow` returns a type missing its decorations -- however this is hopefully
a small risk, as code using the decorated-pointer implementation would already need to know
that following the pointer, never mind the tag at the end of it, could lose information.
Block coverage obtained with "cbmc --cover locations" now reports the file name
and line number of every line of source code contributing to a basic block in
the "description" field of the xml output. (The lines contributing to a block
can come from multiple files via function inlining and definitions in include
files, so reporting line numbers alone is not sufficient.)
There was a mix of empty_typet, void_typet, and actual uses of java_void_type.
At the moment, they are all the same, but there is no compile-time guarantee
that this remains true.
Encapsulate assembler-related code in this folder, and make those driver
programs that need to use it load it from there. Notably, jbmc does not actually
use it, it just had a spurious include.
Specifically - be impartial to deref/cast/address of combinations on the
lhs.
Be impartial to direct assignments without casts
Be impartial to casts before assigning to address of another variable