aboutsummaryrefslogtreecommitdiff
path: root/src/parser.hpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-11-15 17:26:01 +0000
committergingerBill <bill@gingerbill.org>2021-11-15 17:26:01 +0000
commite814a3693f9efbdd00113de4dd5937acd97bc486 (patch)
treeff0534f9609fb8b5726c0933027db9963bb469e4 /src/parser.hpp
parentf55fc4cd08dba25730fa1c74d31611cf27ef2155 (diff)
Improve usage of `file_id`
Diffstat (limited to 'src/parser.hpp')
-rw-r--r--src/parser.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/parser.hpp b/src/parser.hpp
index b1518533e..b83822cbf 100644
--- a/src/parser.hpp
+++ b/src/parser.hpp
@@ -731,8 +731,12 @@ struct Ast {
// NOTE(bill): I know I dislike methods but this is hopefully a temporary thing
// for refactoring purposes
- AstFile *file() const {
- return get_ast_file_from_id(this->file_id);
+ gb_inline AstFile *file() const {
+ // NOTE(bill): This doesn't need to call get_ast_file_from_id which
+ return global_files[this->file_id];
+ }
+ gb_inline AstFile *thread_safe_file() const {
+ return thread_safe_get_ast_file_from_id(this->file_id);
}
};