diff options
Diffstat (limited to 'src/mem/slicc/ast')
-rw-r--r-- | src/mem/slicc/ast/Location.cc | 8 | ||||
-rw-r--r-- | src/mem/slicc/ast/Location.hh | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/mem/slicc/ast/Location.cc b/src/mem/slicc/ast/Location.cc index 6209ccdb7..23d1dba0f 100644 --- a/src/mem/slicc/ast/Location.cc +++ b/src/mem/slicc/ast/Location.cc @@ -39,11 +39,15 @@ #include "mem/slicc/ast/Location.hh" int g_line_number = 0; -string g_file_name(""); +string &g_file_name() +{ + static string the_string; + return the_string; +} Location::Location() { - m_file_name = g_file_name; + m_file_name = g_file_name(); m_line_number = g_line_number; ostringstream sstr; diff --git a/src/mem/slicc/ast/Location.hh b/src/mem/slicc/ast/Location.hh index f070efc46..3233bdb3b 100644 --- a/src/mem/slicc/ast/Location.hh +++ b/src/mem/slicc/ast/Location.hh @@ -42,7 +42,7 @@ #include "mem/slicc/slicc_global.hh" extern int g_line_number; -extern string g_file_name; +extern string &g_file_name(); class Location { public: |