CBMC: /home/runner/work/cbmc/cbmc/src/util/source_location.cpp Source File

Go to the documentation of this file.

1

2

3

4

5

6

7

8

10

12

13#include <filesystem>

14#include <ostream>

15

22

25{

26 std::string dest;

27

33

35 {

36 if(!dest.empty())

37 dest+=' ';

38 dest+="file ";

40 {

43 .string();

44 }

45 else

47 }

49 {

50 if(!dest.empty())

51 dest+=' ';

53 }

54 if(!column.empty())

55 {

56 if(!dest.empty())

57 dest+=' ';

58 dest+="column "+id2string(column);

59 }

60 if(!function.empty())

61 {

62 if(!dest.empty())

63 dest+=' ';

64 dest+="function "+id2string(function);

65 }

66 if(!bytecode.empty())

67 {

68 if(!dest.empty())

69 dest+=' ';

70 dest+="bytecode-index "+id2string(bytecode);

71 }

72

73 return dest;

74}

75

84

89{

91

93 return {};

94

96 .append(file)

97 .string();

98}

99

101 std::ostream &out,

103{

104 if(source_location.is_nil())

105 return out;

106 out << source_location.as_string();

107 return out;

108}

ait supplies three of the four components needed: an abstract interpreter (in this case handling func...

dstringt has one field, an unsigned integer no which is an index into a static table of strings.

const irep_idt & get(const irep_idt &name) const

void set(const irep_idt &name, const irep_idt &value)

void merge(const source_locationt &from)

Set all unset source-location fields in this object to their values in 'from'.

const irep_idt & get_java_bytecode_index() const

const irep_idt & get_column() const

const irep_idt & get_function() const

const irep_idt & get_working_directory() const

const irep_idt & get_file() const

const irep_idt & get_line() const

std::string as_string() const

std::optional< std::string > full_path() const

Get a path to the file, including working directory.

bool has_prefix(const std::string &s, const std::string &prefix)

const std::string & id2string(const irep_idt &d)

std::ostream & operator<<(std::ostream &out, const source_locationt &source_location)