3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-14 14:55:26 +00:00

verilog_location: rename location to Location to avoid conflict with Pass::location

This commit is contained in:
Emil J. Tywoniak 2025-08-08 16:22:54 +02:00
parent 65b53e6473
commit 20b2e47b42
8 changed files with 28 additions and 32 deletions

View file

@ -11,16 +11,16 @@
* but using shared_ptr for filename
*/
struct position {
struct Position {
std::shared_ptr<std::string> filename;
int line;
int column;
position(std::shared_ptr<std::string> filename, int line = 1, int column = 1)
Position(std::shared_ptr<std::string> filename, int line = 1, int column = 1)
: filename(filename), line(line), column(column) {}
position() = default;
position(const position& other) = default;
position& operator=(const position& other) = default;
Position() = default;
Position(const Position& other) = default;
Position& operator=(const Position& other) = default;
void advance() { ++column; }
void columns(int count = 1) {
@ -41,15 +41,15 @@ struct position {
}
};
struct location {
position begin;
position end;
struct Location {
Position begin;
Position end;
location() = default;
location(const position& b, const position& e)
Location() = default;
Location(const Position& b, const Position& e)
: begin(b), end(e) {}
location(const location& other) = default;
location& operator=(const location& other) = default;
Location(const Location& other) = default;
Location& operator=(const Location& other) = default;
void step() { begin = end; }
@ -89,7 +89,7 @@ struct location {
}
};
static inline std::ostream& operator<<(std::ostream& os, const location& loc) {
static inline std::ostream& operator<<(std::ostream& os, const Location& loc) {
return os << loc.to_string();
}