Skip to content

deprecate source_locationt::get/set_function #7239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/util/source_location.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Author: Daniel Kroening, [email protected]
#ifndef CPROVER_UTIL_SOURCE_LOCATION_H
#define CPROVER_UTIL_SOURCE_LOCATION_H

#include "deprecate.h"
#include "irep.h"
#include "optional.h"

Expand Down Expand Up @@ -52,6 +53,14 @@ class source_locationt:public irept
return get(ID_column);
}

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

DEPRECATED(SINCE(2022, 10, 13, "use identifier of containing function"))
void set_function(const irep_idt &function)
{
set(ID_function, function);
Expand Down