Skip to content

Commit 99ce20c

Browse files
committed
deprecate source_locationt::get/set_function
Following #2149, this deprecates source_locationt::get/set_function; the reason is given as a comment.
1 parent 40e0123 commit 99ce20c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/util/source_location.h

+10
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Author: Daniel Kroening, [email protected]
1010
#ifndef CPROVER_UTIL_SOURCE_LOCATION_H
1111
#define CPROVER_UTIL_SOURCE_LOCATION_H
1212

13+
#include "deprecate.h"
1314
#include "irep.h"
1415
#include "optional.h"
1516

@@ -52,6 +53,14 @@ class source_locationt:public irept
5253
return get(ID_column);
5354
}
5455

56+
// This method is problematic for the following reasons:
57+
// 1) There is ambiguity whether
58+
// the returned string is an identifier or human-readable.
59+
// 2) Furthermore, the linker renames functions, and is unable
60+
// to adjust all source locations.
61+
// 3) The name of the function is not strictly a source location.
62+
// It will be removed.
63+
DEPRECATED(SINCE(2022, 10, 13, "use identifier of containing function"))
5564
const irep_idt &get_function() const
5665
{
5766
return get(ID_function);
@@ -117,6 +126,7 @@ class source_locationt:public irept
117126
set(ID_column, column);
118127
}
119128

129+
DEPRECATED(SINCE(2022, 10, 13, "use identifier of containing function"))
120130
void set_function(const irep_idt &function)
121131
{
122132
set(ID_function, function);

0 commit comments

Comments
 (0)