File tree 2 files changed +17
-0
lines changed 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,20 @@ void source_locationt::merge(const source_locationt &from)
71
71
}
72
72
}
73
73
74
+ // / get a path to the file in given source location
75
+ std::string source_locationt::full_path () const
76
+ {
77
+ if (get_file ().empty ())
78
+ return std::string ();
79
+
80
+ const auto file = id2string (get_file ());
81
+
82
+ if (is_built_in (file))
83
+ return std::string ();
84
+
85
+ return concat_dir_file (id2string (get_working_directory ()), file);
86
+ }
87
+
74
88
std::ostream &operator << (
75
89
std::ostream &out,
76
90
const source_locationt &source_location)
Original file line number Diff line number Diff line change @@ -185,6 +185,9 @@ class source_locationt:public irept
185
185
return static_cast <const source_locationt &>(get_nil_irep ());
186
186
}
187
187
188
+ // / get a path to the file, including working directory
189
+ std::string full_path () const ;
190
+
188
191
protected:
189
192
std::string as_string (bool print_cwd) const ;
190
193
};
You can’t perform that action at this time.
0 commit comments