From 55f83494cdc9d3c8714064ad0aecb947020f73b7 Mon Sep 17 00:00:00 2001 From: chaoticgd <43898262+chaoticgd@users.noreply.github.com> Date: Sun, 14 Jan 2024 22:48:37 +0000 Subject: [PATCH] Fix a typo globals_variables -> global_variable --- src/ccc/dependency.cpp | 2 +- src/ccc/mdebug_analysis.cpp | 2 +- src/ccc/symbol_database.cpp | 6 +++--- src/ccc/symbol_database.h | 6 +++--- src/ccc/symbol_json.cpp | 4 ++-- src/uncc.cpp | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ccc/dependency.cpp b/src/ccc/dependency.cpp index 9418abf2..db5c8981 100644 --- a/src/ccc/dependency.cpp +++ b/src/ccc/dependency.cpp @@ -121,7 +121,7 @@ static void map_types_to_files_based_on_reference_count_single_pass(SymbolDataba } } } - for(const GlobalVariable& global_variable : database.global_variables.span(file->globals_variables())) { + for(const GlobalVariable& global_variable : database.global_variables.span(file->global_variables())) { if(global_variable.storage_class != STORAGE_CLASS_STATIC) { if(global_variable.type()) { ast::for_each_node(*global_variable.type(), ast::PREORDER_TRAVERSAL, count_references); diff --git a/src/ccc/mdebug_analysis.cpp b/src/ccc/mdebug_analysis.cpp index 73e09d45..078579af 100644 --- a/src/ccc/mdebug_analysis.cpp +++ b/src/ccc/mdebug_analysis.cpp @@ -272,7 +272,7 @@ Result LocalSymbolTableAnalyser::finish() } m_source_file.set_functions(m_functions, DONT_DELETE_OLD_SYMBOLS, m_database); - m_source_file.set_globals_variables(m_global_variables, DONT_DELETE_OLD_SYMBOLS, m_database); + m_source_file.set_global_variables(m_global_variables, DONT_DELETE_OLD_SYMBOLS, m_database); return Result(); } diff --git a/src/ccc/symbol_database.cpp b/src/ccc/symbol_database.cpp index f6ae4507..71144dc1 100644 --- a/src/ccc/symbol_database.cpp +++ b/src/ccc/symbol_database.cpp @@ -534,13 +534,13 @@ void SourceFile::set_functions( } } -void SourceFile::set_globals_variables( +void SourceFile::set_global_variables( GlobalVariableRange range, ShouldDeleteOldSymbols delete_old_symbols, SymbolDatabase& database) { if(delete_old_symbols == DELETE_OLD_SYMBOLS) { - database.global_variables.destroy_symbols(m_globals_variables); + database.global_variables.destroy_symbols(m_global_variables); } - m_globals_variables = range; + m_global_variables = range; for(GlobalVariable& global_variable : database.global_variables.span(range)) { global_variable.m_source_file = m_handle; } diff --git a/src/ccc/symbol_database.h b/src/ccc/symbol_database.h index a69e932f..97c3cec3 100644 --- a/src/ccc/symbol_database.h +++ b/src/ccc/symbol_database.h @@ -473,8 +473,8 @@ class SourceFile : public Symbol { FunctionRange functions() const { return m_functions; } void set_functions(FunctionRange range, ShouldDeleteOldSymbols delete_old_symbols, SymbolDatabase& database); - GlobalVariableRange globals_variables() const { return m_globals_variables; } - void set_globals_variables(GlobalVariableRange range, ShouldDeleteOldSymbols delete_old_symbols, SymbolDatabase& database); + GlobalVariableRange global_variables() const { return m_global_variables; } + void set_global_variables(GlobalVariableRange range, ShouldDeleteOldSymbols delete_old_symbols, SymbolDatabase& database); std::string working_dir; std::string command_line_path; @@ -484,7 +484,7 @@ class SourceFile : public Symbol { protected: FunctionRange m_functions; - GlobalVariableRange m_globals_variables; + GlobalVariableRange m_global_variables; }; class SymbolSource : public Symbol { diff --git a/src/ccc/symbol_json.cpp b/src/ccc/symbol_json.cpp index 6ae428e1..aee97f49 100644 --- a/src/ccc/symbol_json.cpp +++ b/src/ccc/symbol_json.cpp @@ -284,8 +284,8 @@ static void write_json(JsonWriter& json, const SourceFile& symbol, const SymbolD json.EndArray(); } - if(symbol.globals_variables().valid()) { - auto [begin, end] = database.global_variables.index_pair_from_range(symbol.globals_variables()); + if(symbol.global_variables().valid()) { + auto [begin, end] = database.global_variables.index_pair_from_range(symbol.global_variables()); json.Key("global_variables"); json.StartArray(); json.Uint(begin); diff --git a/src/uncc.cpp b/src/uncc.cpp index 2a2fd167..bf76914e 100644 --- a/src/uncc.cpp +++ b/src/uncc.cpp @@ -271,7 +271,7 @@ static void write_c_cpp_file( for(SourceFileHandle file_handle : files) { const SourceFile* source_file = database.source_files.symbol_from_handle(file_handle); CCC_ASSERT(source_file); - GlobalVariableRange global_variables = source_file->globals_variables(); + GlobalVariableRange global_variables = source_file->global_variables(); for(const GlobalVariable& global_variable : database.global_variables.span(global_variables)) { printer.global_variable(global_variable, database, &read_virtual_func); } @@ -334,7 +334,7 @@ static void write_h_file( for(SourceFileHandle file_handle : files) { const SourceFile* source_file = database.source_files.symbol_from_handle(file_handle); CCC_ASSERT(source_file); - GlobalVariableRange global_variables = source_file->globals_variables(); + GlobalVariableRange global_variables = source_file->global_variables(); for(const GlobalVariable& global_variable : database.global_variables.span(global_variables)) { printer.global_variable(global_variable, database, nullptr); has_global = true;