Skip to content

Commit d44a49d

Browse files
committed
Move documentation of allocate_dynamic_object to header
Following the coding standard.
1 parent 4747b27 commit d44a49d

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

src/util/allocate_objects.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -121,24 +121,6 @@ symbol_exprt allocate_objectst::allocate_automatic_local_object(
121121
return aux_symbol.symbol_expr();
122122
}
123123

124-
/// Generates code for allocating a dynamic object. A new variable with basename
125-
/// prefix `alloc_site` is introduced to which the allocated memory is assigned.
126-
/// Then, the variable is assigned to `target_expr`. For example, with
127-
/// `target_expr` being `*p` the following code is generated:
128-
///
129-
/// `alloc_site$1 = ALLOCATE(object_size, FALSE);`
130-
/// `*p = alloc_site$1;`
131-
///
132-
/// The function returns a dereference expressiont that dereferences the
133-
/// allocation site variable (e.g., `*alloc_site$1`) and which can be used to
134-
/// initialize the allocated memory.
135-
///
136-
/// \param output_code: Code block to which the necessary code is added
137-
/// \param target_expr: A pointer to the allocated memory will be assigned to
138-
/// this (lvalue) expression
139-
/// \param allocate_type: Type of the object allocated
140-
/// \return A dereference_exprt that dereferences the pointer to the allocated
141-
/// memory, or an empty expression when `allocate_type` is void
142124
exprt allocate_objectst::allocate_dynamic_object(
143125
code_blockt &output_code,
144126
const exprt &target_expr,

src/util/allocate_objects.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,25 @@ class allocate_objectst
6262
const typet &allocate_type,
6363
const irep_idt &basename_prefix = "tmp");
6464

65+
/// Generates code for allocating a dynamic object. A new variable with
66+
/// basename prefix `alloc_site` is introduced to which the allocated memory
67+
/// is assigned.
68+
/// Then, the variable is assigned to `target_expr`. For example, with
69+
/// `target_expr` being `*p` the following code is generated:
70+
///
71+
/// `alloc_site$1 = ALLOCATE(object_size, FALSE);`
72+
/// `*p = alloc_site$1;`
73+
///
74+
/// The function returns a dereference expressiont that dereferences the
75+
/// allocation site variable (e.g., `*alloc_site$1`) and which can be used to
76+
/// initialize the allocated memory.
77+
///
78+
/// \param output_code: Code block to which the necessary code is added
79+
/// \param target_expr: A pointer to the allocated memory will be assigned to
80+
/// this (lvalue) expression
81+
/// \param allocate_type: Type of the object allocated
82+
/// \return A dereference_exprt that dereferences the pointer to the allocated
83+
/// memory, or an empty expression when `allocate_type` is void
6584
exprt allocate_dynamic_object(
6685
code_blockt &output_code,
6786
const exprt &target_expr,

0 commit comments

Comments
 (0)