Skip to content

Commit

Permalink
organize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Vexu committed Nov 4, 2024
1 parent d1da291 commit 337cb2e
Show file tree
Hide file tree
Showing 28 changed files with 119 additions and 85 deletions.
2 changes: 1 addition & 1 deletion src/aro.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ pub const Driver = @import("aro/Driver.zig");
pub const Parser = @import("aro/Parser.zig");
pub const Preprocessor = @import("aro/Preprocessor.zig");
pub const Source = @import("aro/Source.zig");
pub const target_util = @import("aro/target.zig");
pub const Tokenizer = @import("aro/Tokenizer.zig");
pub const Toolchain = @import("aro/Toolchain.zig");
pub const Tree = @import("aro/Tree.zig");
pub const Type = @import("aro/Type.zig");
pub const TypeMapper = @import("aro/StringInterner.zig").TypeMapper;
pub const target_util = @import("aro/target.zig");
pub const Value = @import("aro/Value.zig");

const backend = @import("backend");
Expand Down
9 changes: 5 additions & 4 deletions src/aro/Builtins.zig
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const std = @import("std");

const Compilation = @import("Compilation.zig");
const Type = @import("Type.zig");
const TypeDescription = @import("Builtins/TypeDescription.zig");
const target_util = @import("target.zig");
const StringId = @import("StringInterner.zig").StringId;
const LangOpts = @import("LangOpts.zig");
const Parser = @import("Parser.zig");
const StringId = @import("StringInterner.zig").StringId;
const target_util = @import("target.zig");
const Type = @import("Type.zig");
const TypeDescription = @import("Builtins/TypeDescription.zig");

const Properties = @import("Builtins/Properties.zig");
pub const Builtin = @import("Builtins/Builtin.def").with(Properties);
Expand Down
4 changes: 3 additions & 1 deletion src/aro/CodeGen.zig
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
const std = @import("std");
const Allocator = std.mem.Allocator;
const assert = std.debug.assert;

const backend = @import("backend");
const Interner = backend.Interner;
const Ir = backend.Ir;
const Builder = Ir.Builder;

const Builtins = @import("Builtins.zig");
const Builtin = Builtins.Builtin;
const Compilation = @import("Compilation.zig");
const Builder = Ir.Builder;
const StrInt = @import("StringInterner.zig");
const StringId = StrInt.StringId;
const Tree = @import("Tree.zig");
Expand Down
12 changes: 7 additions & 5 deletions src/aro/Compilation.zig
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
const std = @import("std");
const Allocator = mem.Allocator;
const assert = std.debug.assert;
const EpochSeconds = std.time.epoch.EpochSeconds;
const mem = std.mem;
const Allocator = mem.Allocator;

const backend = @import("backend");
const Interner = backend.Interner;
const CodeGenOptions = backend.CodeGenOptions;

const Builtins = @import("Builtins.zig");
const Builtin = Builtins.Builtin;
const Diagnostics = @import("Diagnostics.zig");
const LangOpts = @import("LangOpts.zig");
const Pragma = @import("Pragma.zig");
const record_layout = @import("record_layout.zig");
const Source = @import("Source.zig");
const StrInt = @import("StringInterner.zig");
const target_util = @import("target.zig");
const Tokenizer = @import("Tokenizer.zig");
const Token = Tokenizer.Token;
const Type = @import("Type.zig");
const Pragma = @import("Pragma.zig");
const StrInt = @import("StringInterner.zig");
const record_layout = @import("record_layout.zig");
const target_util = @import("target.zig");

pub const Error = error{
/// A fatal error has ocurred and compilation has stopped.
Expand Down
10 changes: 6 additions & 4 deletions src/aro/Diagnostics.zig
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
const std = @import("std");
const Allocator = mem.Allocator;
const mem = std.mem;
const Source = @import("Source.zig");
const Compilation = @import("Compilation.zig");
const Allocator = mem.Allocator;

const Attribute = @import("Attribute.zig");
const Builtins = @import("Builtins.zig");
const Builtin = Builtins.Builtin;
const Header = @import("Builtins/Properties.zig").Header;
const Compilation = @import("Compilation.zig");
const LangOpts = @import("LangOpts.zig");
const Source = @import("Source.zig");
const Tree = @import("Tree.zig");

const is_windows = @import("builtin").os.tag == .windows;
const LangOpts = @import("LangOpts.zig");

pub const Message = struct {
tag: Tag,
Expand Down
9 changes: 5 additions & 4 deletions src/aro/Driver.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ const std = @import("std");
const mem = std.mem;
const Allocator = mem.Allocator;
const process = std.process;
const StaticStringSet = std.StaticStringMap(void);

const backend = @import("backend");
const Ir = backend.Ir;
const Object = backend.Object;

const Compilation = @import("Compilation.zig");
const Diagnostics = @import("Diagnostics.zig");
const GCCVersion = @import("Driver/GCCVersion.zig");
const LangOpts = @import("LangOpts.zig");
const Preprocessor = @import("Preprocessor.zig");
const Source = @import("Source.zig");
const Toolchain = @import("Toolchain.zig");
const target_util = @import("target.zig");
const GCCVersion = @import("Driver/GCCVersion.zig");
const Toolchain = @import("Toolchain.zig");

pub const Linker = enum {
ld,
Expand All @@ -23,7 +24,7 @@ pub const Linker = enum {
mold,
};

const pic_related_options = StaticStringSet.initComptime(.{
const pic_related_options = std.StaticStringMap(void).initComptime(.{
.{"-fpic"},
.{"-fno-pic"},
.{"-fPIC"},
Expand Down
6 changes: 4 additions & 2 deletions src/aro/Driver/GCCDetector.zig
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const std = @import("std");
const Toolchain = @import("../Toolchain.zig");
const target_util = @import("../target.zig");

const system_defaults = @import("system_defaults");

const GCCVersion = @import("GCCVersion.zig");
const Multilib = @import("Multilib.zig");
const target_util = @import("../target.zig");
const Toolchain = @import("../Toolchain.zig");

const GCCDetector = @This();

Expand Down
3 changes: 2 additions & 1 deletion src/aro/Hideset.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
const std = @import("std");
const mem = std.mem;
const Allocator = mem.Allocator;
const Source = @import("Source.zig");

const Compilation = @import("Compilation.zig");
const Source = @import("Source.zig");
const Tokenizer = @import("Tokenizer.zig");

pub const Hideset = @This();
Expand Down
6 changes: 3 additions & 3 deletions src/aro/InitList.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
const std = @import("std");
const Allocator = std.mem.Allocator;
const testing = std.testing;

const Diagnostics = @import("Diagnostics.zig");
const Parser = @import("Parser.zig");
const Tree = @import("Tree.zig");
const Token = Tree.Token;
const TokenIndex = Tree.TokenIndex;
const NodeIndex = Tree.NodeIndex;
const Type = @import("Type.zig");
const Diagnostics = @import("Diagnostics.zig");
const NodeList = std.ArrayList(NodeIndex);
const Parser = @import("Parser.zig");

const Item = struct {
list: InitList = .{},
Expand Down
3 changes: 2 additions & 1 deletion src/aro/LangOpts.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const std = @import("std");
const DiagnosticTag = @import("Diagnostics.zig").Tag;

const char_info = @import("char_info.zig");
const DiagnosticTag = @import("Diagnostics.zig").Tag;

pub const Compiler = enum {
clang,
Expand Down
33 changes: 17 additions & 16 deletions src/aro/Parser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,35 @@ const mem = std.mem;
const Allocator = mem.Allocator;
const assert = std.debug.assert;
const big = std.math.big;

const Attribute = @import("Attribute.zig");
const Builtins = @import("Builtins.zig");
const Builtin = Builtins.Builtin;
const evalBuiltin = @import("Builtins/eval.zig").eval;
const char_info = @import("char_info.zig");
const Compilation = @import("Compilation.zig");
const Diagnostics = @import("Diagnostics.zig");
const InitList = @import("InitList.zig");
const Preprocessor = @import("Preprocessor.zig");
const record_layout = @import("record_layout.zig");
const Source = @import("Source.zig");
const StrInt = @import("StringInterner.zig");
const StringId = StrInt.StringId;
const SymbolStack = @import("SymbolStack.zig");
const Symbol = SymbolStack.Symbol;
const target_util = @import("target.zig");
const text_literal = @import("text_literal.zig");
const Tokenizer = @import("Tokenizer.zig");
const Preprocessor = @import("Preprocessor.zig");
const Tree = @import("Tree.zig");
const Token = Tree.Token;
const NumberPrefix = Token.NumberPrefix;
const NumberSuffix = Token.NumberSuffix;
const TokenIndex = Tree.TokenIndex;
const NodeIndex = Tree.NodeIndex;
const Type = @import("Type.zig");
const Diagnostics = @import("Diagnostics.zig");
const NodeList = std.ArrayList(NodeIndex);
const InitList = @import("InitList.zig");
const Attribute = @import("Attribute.zig");
const char_info = @import("char_info.zig");
const text_literal = @import("text_literal.zig");
const Value = @import("Value.zig");
const SymbolStack = @import("SymbolStack.zig");
const Symbol = SymbolStack.Symbol;
const record_layout = @import("record_layout.zig");
const StrInt = @import("StringInterner.zig");
const StringId = StrInt.StringId;
const Builtins = @import("Builtins.zig");
const Builtin = Builtins.Builtin;
const evalBuiltin = @import("Builtins/eval.zig").eval;
const target_util = @import("target.zig");

const NodeList = std.ArrayList(NodeIndex);
const Switch = struct {
default: ?TokenIndex = null,
ranges: std.ArrayList(Range),
Expand Down
3 changes: 2 additions & 1 deletion src/aro/Pragma.zig
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const std = @import("std");

const Compilation = @import("Compilation.zig");
const Preprocessor = @import("Preprocessor.zig");
const Parser = @import("Parser.zig");
const Preprocessor = @import("Preprocessor.zig");
const TokenIndex = @import("Tree.zig").TokenIndex;

pub const Error = Compilation.Error || error{ UnknownPragma, StopPreprocessing };
Expand Down
11 changes: 6 additions & 5 deletions src/aro/Preprocessor.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@ const std = @import("std");
const mem = std.mem;
const Allocator = mem.Allocator;
const assert = std.debug.assert;

const Attribute = @import("Attribute.zig");
const Compilation = @import("Compilation.zig");
const Error = Compilation.Error;
const Diagnostics = @import("Diagnostics.zig");
const features = @import("features.zig");
const Hideset = @import("Hideset.zig");
const Parser = @import("Parser.zig");
const Source = @import("Source.zig");
const Tokenizer = @import("Tokenizer.zig");
const RawToken = Tokenizer.Token;
const Parser = @import("Parser.zig");
const Diagnostics = @import("Diagnostics.zig");
const Tree = @import("Tree.zig");
const Token = Tree.Token;
const TokenWithExpansionLocs = Tree.TokenWithExpansionLocs;
const Attribute = @import("Attribute.zig");
const features = @import("features.zig");
const Hideset = @import("Hideset.zig");

const DefineMap = std.StringHashMapUnmanaged(Macro);
const RawTokenList = std.ArrayList(RawToken);
Expand Down
5 changes: 3 additions & 2 deletions src/aro/SymbolStack.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ const std = @import("std");
const mem = std.mem;
const Allocator = mem.Allocator;
const assert = std.debug.assert;

const Parser = @import("Parser.zig");
const StringId = @import("StringInterner.zig").StringId;
const Tree = @import("Tree.zig");
const Token = Tree.Token;
const TokenIndex = Tree.TokenIndex;
const NodeIndex = Tree.NodeIndex;
const Type = @import("Type.zig");
const Parser = @import("Parser.zig");
const Value = @import("Value.zig");
const StringId = @import("StringInterner.zig").StringId;

const SymbolStack = @This();

Expand Down
3 changes: 2 additions & 1 deletion src/aro/Tokenizer.zig
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const std = @import("std");
const assert = std.debug.assert;

const Compilation = @import("Compilation.zig");
const Source = @import("Source.zig");
const LangOpts = @import("LangOpts.zig");
const Source = @import("Source.zig");

pub const Token = struct {
id: Id,
Expand Down
10 changes: 6 additions & 4 deletions src/aro/Toolchain.zig
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
const std = @import("std");
const Driver = @import("Driver.zig");
const Compilation = @import("Compilation.zig");
const mem = std.mem;

const system_defaults = @import("system_defaults");

const Compilation = @import("Compilation.zig");
const Driver = @import("Driver.zig");
const Filesystem = @import("Driver/Filesystem.zig").Filesystem;
const Multilib = @import("Driver/Multilib.zig");
const target_util = @import("target.zig");
const Linux = @import("toolchains/Linux.zig");
const Multilib = @import("Driver/Multilib.zig");
const Filesystem = @import("Driver/Filesystem.zig").Filesystem;

pub const PathList = std.ArrayListUnmanaged([]const u8);

Expand Down
4 changes: 3 additions & 1 deletion src/aro/Tree.zig
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
const std = @import("std");

const Interner = @import("backend").Interner;

const Attribute = @import("Attribute.zig");
const CodeGen = @import("CodeGen.zig");
const Compilation = @import("Compilation.zig");
const number_affixes = @import("Tree/number_affixes.zig");
const Source = @import("Source.zig");
const StringInterner = @import("StringInterner.zig");
const Tokenizer = @import("Tokenizer.zig");
const Type = @import("Type.zig");
const Value = @import("Value.zig");
const StringInterner = @import("StringInterner.zig");

pub const Token = struct {
id: Id,
Expand Down
13 changes: 7 additions & 6 deletions src/aro/Type.zig
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
const std = @import("std");
const Tree = @import("Tree.zig");
const TokenIndex = Tree.TokenIndex;
const NodeIndex = Tree.NodeIndex;
const Parser = @import("Parser.zig");
const Compilation = @import("Compilation.zig");

const Attribute = @import("Attribute.zig");
const Compilation = @import("Compilation.zig");
const LangOpts = @import("LangOpts.zig");
const Parser = @import("Parser.zig");
const StringInterner = @import("StringInterner.zig");
const StringId = StringInterner.StringId;
const target_util = @import("target.zig");
const LangOpts = @import("LangOpts.zig");
const Tree = @import("Tree.zig");
const TokenIndex = Tree.TokenIndex;
const NodeIndex = Tree.NodeIndex;

pub const Qualifiers = packed struct {
@"const": bool = false,
Expand Down
8 changes: 5 additions & 3 deletions src/aro/Value.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ const std = @import("std");
const assert = std.debug.assert;
const BigIntConst = std.math.big.int.Const;
const BigIntMutable = std.math.big.int.Mutable;

const Interner = @import("backend").Interner;
const BigIntSpace = Interner.Tag.Int.BigIntSpace;

const annex_g = @import("annex_g.zig");
const Compilation = @import("Compilation.zig");
const StringInterner = @import("StringInterner.zig");
const StringId = StringInterner.StringId;
const Compilation = @import("Compilation.zig");
const Type = @import("Type.zig");
const target_util = @import("target.zig");
const annex_g = @import("annex_g.zig");
const Type = @import("Type.zig");

const Value = @This();

Expand Down
5 changes: 3 additions & 2 deletions src/aro/pragmas/gcc.zig
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const std = @import("std");
const mem = std.mem;

const Compilation = @import("../Compilation.zig");
const Pragma = @import("../Pragma.zig");
const Diagnostics = @import("../Diagnostics.zig");
const Preprocessor = @import("../Preprocessor.zig");
const Parser = @import("../Parser.zig");
const Pragma = @import("../Pragma.zig");
const Preprocessor = @import("../Preprocessor.zig");
const TokenIndex = @import("../Tree.zig").TokenIndex;

const GCC = @This();
Expand Down
Loading

0 comments on commit 337cb2e

Please sign in to comment.