The source location of a token.
More...
#include <abg-ir.h>
The source location of a token.
This represents the location of a token coming from a given translation unit. This location is actually an abstraction of cursor in the table of all the locations of all the tokens of the translation unit. That table is managed by the location_manager type. To get the file path, line and column numbers associated to a given instance of location, you need to use the location_manager::expand_location method.
Definition at line 306 of file abg-ir.h.
◆ location() [1/2]
Copy constructor of the location.
- Parameters
-
l | the location to copy from. |
Definition at line 370 of file abg-ir.h.
◆ location() [2/2]
◆ expand() [1/2]
void expand |
( |
std::string & | path, |
|
|
unsigned & | line, |
|
|
unsigned & | column ) const |
Expand the current location into a tripplet file path, line and column number.
Expand the location into a tripplet path, line and column number.
- Parameters
-
path | the output parameter this function sets the expanded path to. |
line | the output parameter this function sets the expanded line number to. |
column | the output parameter this function sets the expanded column number to. |
path | the output parameter where this function sets the expanded path. |
line | the output parameter where this function sets the expanded line. |
column | the ouptut parameter where this function sets the expanded column. |
Definition at line 452 of file abg-ir.cc.
◆ expand() [2/2]
string expand |
( |
void | | ) |
const |
Expand the location into a string.
- Returns
- the string representing the location.
Definition at line 472 of file abg-ir.cc.
◆ get_is_artificial()
bool get_is_artificial |
( |
| ) |
const |
|
inline |
Test if the location is artificial.
Being artificial means that the location wasn't generated by the original emitter of the metadata (i.e, the compiler if the metadata is debug info). For instance, the implicit location derived from the position of a given XML element in the abixml file is represented as artificial locations. The same XML element might carry a non-artificial (natural?) location that was originally emitted by the compiler that generated the original debug info the abixml file is derived from.
- Returns
- true iff the location is artificial.
Definition at line 348 of file abg-ir.h.
◆ get_value()
unsigned get_value |
( |
| ) |
const |
|
inline |
Get the value of the location.
Definition at line 395 of file abg-ir.h.
◆ operator bool()
Convert the location into a boolean.
- Returns
- true iff the value of the location is different from zero.
Definition at line 402 of file abg-ir.h.
◆ operator<()
bool operator< |
( |
const location & | other | ) |
const |
|
inline |
"Less than" operator of the location type.
@parm other the other location type to compare against.
- Returns
- true iff the current instance is less than the
other
one.
Definition at line 420 of file abg-ir.h.
◆ operator=()
Assignment operator of the location.
- Parameters
-
l | the location to assign to the current one. |
Definition at line 380 of file abg-ir.h.
◆ operator==()
bool operator== |
( |
const location & | other | ) |
const |
|
inline |
Equality operator of the location type.
- Parameters
-
other | the other location to compare against. |
- Returns
- true iff both locations are equal.
Definition at line 411 of file abg-ir.h.
◆ set_is_artificial()
void set_is_artificial |
( |
bool | f | ) |
|
|
inline |
Set the artificial-ness of the location.
Being artificial means that the location wasn't generated by the original emitter of the metadata (i.e, the compiler if the metadata is debug info). For instance, the implicit location derived from the position of a given XML element in the abixml file is represented as artificial locations. The same XML element might carry a non-artificial (natural?) location that was originally emitted by the compiler that generated the original debug info the abixml file is derived from.
- Parameters
-
f | the new artificial-ness state. |
Definition at line 364 of file abg-ir.h.
◆ location_manager
The documentation for this class was generated from the following files:
- /home/dodji/git/libabigail/master/include/abg-ir.h
- /home/dodji/git/libabigail/master/src/abg-ir.cc