Skip to content

Commit

Permalink
Fix a typo
Browse files Browse the repository at this point in the history
globals_variables -> global_variable
  • Loading branch information
chaoticgd committed Jan 14, 2024
1 parent d236daa commit 55f8349
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/ccc/dependency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/ccc/mdebug_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ Result<void> 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<void>();
}
Expand Down
6 changes: 3 additions & 3 deletions src/ccc/symbol_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions src/ccc/symbol_database.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -484,7 +484,7 @@ class SourceFile : public Symbol {

protected:
FunctionRange m_functions;
GlobalVariableRange m_globals_variables;
GlobalVariableRange m_global_variables;
};

class SymbolSource : public Symbol {
Expand Down
4 changes: 2 additions & 2 deletions src/ccc/symbol_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/uncc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 55f8349

Please sign in to comment.