Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/ccc/dwarf_attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class Value {
std::span<const u8> block_or_null() const;
std::string_view string_or_null() const;

protected:
private:
u8 m_form = 0;
union {
u32 address;
Expand Down Expand Up @@ -147,7 +147,7 @@ class LocationDescription {

Result<void> print(FILE* out) const;

protected:
private:
Result<LocationAtom> parse_atom(u32& offset) const;

std::span<const u8> m_block;
Expand Down Expand Up @@ -207,7 +207,7 @@ class Type {
Result<u32> user_def_type() const;
Result<std::span<const TypeModifier>> modifiers() const;

protected:
private:
u32 m_attribute = 0;
Value m_value;
};
Expand Down Expand Up @@ -260,7 +260,7 @@ class ArrayBound {

Result<void> print(FILE* out) const;

protected:
private:
ArrayBoundType m_type = ArrayBoundType::NIL;
u32 m_constant = 0;
LocationDescription m_location_description;
Expand All @@ -282,7 +282,7 @@ class ArraySubscriptData {

Result<ArraySubscriptItem> parse_item(u32& offset, u32 importer_flags) const;

protected:
private:
Result<u16> parse_fund_type(u32& offset) const;
Result<u32> parse_user_def_type(u32& offset) const;
Result<u32> parse_constant(u32& offset) const;
Expand All @@ -304,7 +304,7 @@ class EnumerationElementList {

Result<EnumerationElement> parse_element(u32& offset) const;

protected:
private:
std::span<const u8> m_block;
};

Expand Down
2 changes: 1 addition & 1 deletion src/ccc/dwarf_forge.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Forge {
// Output the result.
std::vector<u8> finish();

protected:
private:
template <typename T>
u32 push(T value)
{
Expand Down
2 changes: 1 addition & 1 deletion src/ccc/dwarf_importer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SymbolTableImporter {
// compilation units associated with the specified overlay.
Result<void> import_overlay(u32 overlay_id, SymbolGroup group);

protected:
private:
Result<void> import_compile_units(std::optional<u32> overlay_id, SymbolGroup group);
Result<void> import_compile_unit(const DIE& die);
Result<void> import_data_type(const DIE& die);
Expand Down
2 changes: 1 addition & 1 deletion src/ccc/dwarf_printer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SymbolPrinter {
Result<void> print_subscr_data(FILE* out, const ArraySubscriptData& subscript_data) const;
Result<void> print_enumeration_element_list(FILE* out, const EnumerationElementList& element_list) const;

protected:
private:
SectionReader& m_reader;
};

Expand Down
4 changes: 2 additions & 2 deletions src/ccc/dwarf_section.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class DIE {
// Parse the attributes, and output them all in order.
Result<std::vector<AttributeTuple>> all_attributes() const;

protected:
private:
std::span<const u8> m_debug;
u32 m_offset;
u32 m_length;
Expand All @@ -115,7 +115,7 @@ class SectionReader {

u32 importer_flags() const;

protected:
private:
std::span<const u8> m_debug;
std::span<const u8> m_line;
u32 m_importer_flags;
Expand Down
2 changes: 1 addition & 1 deletion src/ccc/dwarf_to_ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TypeImporter {
Result<std::unique_ptr<ast::Node>> fundamental_type_to_ast(FundamentalType fund_type);
Result<std::unique_ptr<ast::Node>> die_to_ast(const DIE& die);

protected:
private:
Result<std::unique_ptr<ast::Node>> array_type_to_ast(const DIE& die);

SymbolDatabase& m_database;
Expand Down
2 changes: 1 addition & 1 deletion src/ccc/mdebug_section.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class SymbolTableReader {
void print_header(FILE* out) const;
Result<void> print_symbols(FILE* out, bool print_locals, bool print_procedure_descriptors, bool print_externals) const;

protected:
private:
bool m_ready = false;

std::span<const u8> m_elf;
Expand Down
2 changes: 1 addition & 1 deletion src/ccc/print_cpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CppPrinter {
void global_variable(
const GlobalVariable& symbol, const SymbolDatabase& database, const ElfFile* elf);

protected:
private:
void ast_node(
const ast::Node& node,
VariableName& parent_name,
Expand Down
22 changes: 11 additions & 11 deletions src/ccc/symbol_database.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class SymbolList {
// worry about dangling handles.
void clear();

protected:
private:
// Do a binary search for a handle, and return either its index, or the
// index where it could be inserted.
size_t binary_search(SymbolHandle<SymbolType> handle) const;
Expand Down Expand Up @@ -322,7 +322,7 @@ class FunctionHash {
return m_hash;
}

protected:
private:
u32 m_hash = 0;
};

Expand Down Expand Up @@ -392,7 +392,7 @@ class Function : public Symbol {
bool is_member_function_ish = false; // Filled in by fill_in_pointers_to_member_function_definitions.
bool is_no_return = false;

protected:
private:
void on_destroy(SymbolDatabase* database);

SourceFileHandle m_source_file;
Expand Down Expand Up @@ -422,7 +422,7 @@ class GlobalVariable : public Symbol {
GlobalStorage storage;
StorageClass storage_class = STORAGE_CLASS_NONE;

protected:
private:
SourceFileHandle m_source_file;
std::string m_mangled_name;
};
Expand Down Expand Up @@ -456,7 +456,7 @@ class LocalVariable : public Symbol {
std::variant<GlobalStorage, RegisterStorage, StackStorage> storage;
AddressRange live_range;

protected:
private:
FunctionHandle m_function;
};

Expand All @@ -479,7 +479,7 @@ class Module : public Symbol {
s32 version_major = -1;
s32 version_minor = -1;

protected:
private:
void on_create();
};

Expand All @@ -496,7 +496,7 @@ class ParameterVariable : public Symbol {

std::variant<RegisterStorage, StackStorage> storage;

protected:
private:
FunctionHandle m_function;
};

Expand Down Expand Up @@ -544,7 +544,7 @@ class SourceFile : public Symbol {
std::map<StabsTypeNumber, DataTypeHandle> stabs_type_number_to_handle;
std::set<std::string> toolchain_version_info;

protected:
private:
void on_destroy(SymbolDatabase* database);

std::vector<FunctionHandle> m_functions;
Expand All @@ -564,7 +564,7 @@ class SymbolSource : public Symbol {

SymbolSourceHandle handle() const { return m_handle; }

protected:
private:
void on_create();
};

Expand Down Expand Up @@ -680,7 +680,7 @@ class MultiSymbolHandle {

friend auto operator<=>(const MultiSymbolHandle& lhs, const MultiSymbolHandle& rhs) = default;

protected:
private:
SymbolDescriptor m_descriptor = DATA_TYPE;
RawSymbolHandle m_handle = NULL_SYMBOL_HANDLE;
};
Expand Down Expand Up @@ -711,7 +711,7 @@ class NodeHandle {

friend auto operator<=>(const NodeHandle& lhs, const NodeHandle& rhs) = default;

protected:
private:
MultiSymbolHandle m_symbol;
const ast::Node* m_node = nullptr;
u32 m_generation = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/ccc/symbol_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ElfSymbolFile : public SymbolFile {

const ElfFile& elf() const;

protected:
private:
ElfFile m_elf;
std::string m_name;
};
Expand All @@ -55,7 +55,7 @@ class SNDLLSymbolFile : public SymbolFile {
Result<std::vector<std::unique_ptr<SymbolTable>>> get_symbol_tables_from_sections(
const std::vector<SymbolTableLocation>& sections) const override;

protected:
private:
std::shared_ptr<SNDLLFile> m_sndll;
};

Expand Down
10 changes: 5 additions & 5 deletions src/ccc/symbol_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class MdebugSymbolTable : public SymbolTable {
Result<void> print_headers(FILE* out) const override;
Result<void> print_symbols(FILE* out, u32 flags) const override;

protected:
private:
std::span<const u8> m_image;
s32 m_section_offset;
};
Expand All @@ -117,7 +117,7 @@ class DwarfSymbolTable : public SymbolTable {
Result<void> print_headers(FILE* out) const override;
Result<void> print_symbols(FILE* out, u32 flags) const override;

protected:
private:
std::span<const u8> m_debug;
std::span<const u8> m_line;
};
Expand All @@ -138,7 +138,7 @@ class SymtabSymbolTable : public SymbolTable {
Result<void> print_headers(FILE* out) const override;
Result<void> print_symbols(FILE* out, u32 flags) const override;

protected:
private:
std::span<const u8> m_symtab;
std::span<const u8> m_strtab;
};
Expand All @@ -161,7 +161,7 @@ class SNDLLSymbolTable : public SymbolTable {
Result<void> print_headers(FILE* out) const override;
Result<void> print_symbols(FILE* out, u32 flags) const override;

protected:
private:
std::shared_ptr<SNDLLFile> m_sndll;
};

Expand All @@ -180,7 +180,7 @@ class ElfSectionHeadersSymbolTable : public SymbolTable {

Result<void> print_headers(FILE* out) const override;
Result<void> print_symbols(FILE* out, u32 flags) const override;
protected:
private:
const ElfFile& m_elf;
};

Expand Down
2 changes: 1 addition & 1 deletion src/ccc/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ template <typename Value>
class [[nodiscard]] CCC_WARN_UNUSED Result {
template <typename OtherValue>
friend class Result;
protected:
private:
Value m_value;
std::unique_ptr<Error> m_error;

Expand Down
Loading