cprover
synthetic_methods_map.h File Reference

Synthetic methods are particular methods internally generated by the Java frontend, including thunks to ensure static initializers are run once and initializers created for unknown / stub types. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef std::unordered_map< irep_idt, synthetic_method_typetsynthetic_methods_mapt
 Maps method names on to a synthetic method kind. More...
 

Enumerations

enum  synthetic_method_typet { synthetic_method_typet::STATIC_INITIALIZER_WRAPPER, synthetic_method_typet::STUB_CLASS_STATIC_INITIALIZER }
 Synthetic method kinds. More...
 

Detailed Description

Synthetic methods are particular methods internally generated by the Java frontend, including thunks to ensure static initializers are run once and initializers created for unknown / stub types.

Compare normal methods, which are translated from Java bytecode. This file provides an enumeration specifying the kind of a particular synthetic method and a common type of a map giving a collection of synthetic methods. Functions stubs and array.clone() functions are also generated by the Java frontend but are not recorded using this framework, but may be in future.

Definition in file synthetic_methods_map.h.

Typedef Documentation

◆ synthetic_methods_mapt

Maps method names on to a synthetic method kind.

Definition at line 38 of file synthetic_methods_map.h.

Enumeration Type Documentation

◆ synthetic_method_typet

Synthetic method kinds.

Enumerator
STATIC_INITIALIZER_WRAPPER 

A static initializer wrapper (code of the form if(!already_run) clinit(); already_run = true;) These are generated for both user and stub types, to ensure the actual static initializer is only run once on any given path.

STUB_CLASS_STATIC_INITIALIZER 

A generated (synthetic) static initializer function for a stub type.

Because we don't have the bytecode for a stub type (by definition), we generate a static initializer function to initialize its static fields.

Definition at line 23 of file synthetic_methods_map.h.