Skip to content

Commit

Permalink
Cleanup unused imports and globals
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharsadhwani authored and sin-ack committed Sep 3, 2024
1 parent 0610529 commit 14aa1c9
Show file tree
Hide file tree
Showing 37 changed files with 0 additions and 65 deletions.
2 changes: 0 additions & 2 deletions src/language/Range.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@
//! not contain line and column information; that information should be obtained
//! when necessary from the script.

const std = @import("std");

start: usize,
end: usize,
2 changes: 0 additions & 2 deletions src/language/Token.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

//! A single token.

const std = @import("std");

tag: Tag,
location: Location,

Expand Down
2 changes: 0 additions & 2 deletions src/runtime/Activation.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//
// SPDX-License-Identifier: GPL-3.0-only

const builtin = @import("builtin");
const std = @import("std");
const Allocator = std.mem.Allocator;

Expand All @@ -14,7 +13,6 @@ const bytecode = @import("./bytecode.zig");
const SourceRange = @import("./SourceRange.zig");
const IntegerValue = value.IntegerValue;
const MethodObject = @import("objects/method.zig").Method;
const VirtualMachine = @import("./VirtualMachine.zig");
const ActivationObject = @import("objects/activation.zig").Activation;

/// The ID of the activation which is used with ActivationRef in order to check
Expand Down
2 changes: 0 additions & 2 deletions src/runtime/ByteArray.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
//
// SPDX-License-Identifier: GPL-3.0-only

const std = @import("std");

const Heap = @import("./Heap.zig");
const value = @import("./value.zig");
const Value = value.Value;
Expand Down
3 changes: 0 additions & 3 deletions src/runtime/Heap.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
const std = @import("std");
const builtin = @import("builtin");
const Allocator = std.mem.Allocator;
const ArenaAllocator = std.heap.ArenaAllocator;

const hash = @import("../utility/hash.zig");
const debug = @import("../debug.zig");
const Value = @import("./value.zig").Value;
const Object = @import("./object.zig").Object;
Expand All @@ -16,7 +14,6 @@ const Reference = @import("value.zig").Reference;
const Activation = @import("./Activation.zig");
const BaseObject = @import("./base_object.zig").BaseObject;
const VirtualMachine = @import("./VirtualMachine.zig");
const ActivationStack = Activation.ActivationStack;

const GC_DEBUG = debug.GC_DEBUG;
const GC_TOKEN_DEBUG = debug.GC_TOKEN_DEBUG;
Expand Down
2 changes: 0 additions & 2 deletions src/runtime/RuntimeError.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const std = @import("std");
const Allocator = std.mem.Allocator;

const context = @import("context.zig");
const Activation = @import("./Activation.zig");
const SourceRange = @import("./SourceRange.zig");
const VirtualMachine = @import("./VirtualMachine.zig");

/// The error message. This can be either Literal (non-owned) or Formatted (owned).
message: Message,
Expand Down
2 changes: 0 additions & 2 deletions src/runtime/VirtualMachine.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ const std = @import("std");
const Allocator = std.mem.Allocator;

const Heap = @import("./Heap.zig");
const Slot = @import("./slot.zig").Slot;
const Actor = @import("./Actor.zig");
const Value = @import("./value.zig").Value;
const Range = @import("../language/Range.zig");
const Script = @import("../language/Script.zig");
const AstGen = @import("./bytecode/AstGen.zig");
const context = @import("context.zig");
Expand Down
1 change: 0 additions & 1 deletion src/runtime/bytecode/AstGen.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const primitives = @import("../primitives.zig");

const Block = astcode.Block;
const Executable = astcode.Executable;
const Instruction = astcode.Instruction;
const RegisterLocation = astcode.RegisterLocation;

const AST_EXECUTABLE_DUMP_DEBUG = debug.AST_EXECUTABLE_DUMP_DEBUG;
Expand Down
1 change: 0 additions & 1 deletion src/runtime/bytecode/lowcode/RegisterFile.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: GPL-3.0-only

const std = @import("std");
const Allocator = std.mem.Allocator;

const Value = @import("../../value.zig").Value;
const RegisterLocation = @import("./register_location.zig").RegisterLocation;
Expand Down
1 change: 0 additions & 1 deletion src/runtime/execution_result.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: GPL-3.0-only

const std = @import("std");
const Allocator = std.mem.Allocator;

const Value = @import("value.zig").Value;
const RuntimeError = @import("RuntimeError.zig");
Expand Down
3 changes: 0 additions & 3 deletions src/runtime/intrinsic_map.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ const Allocator = std.mem.Allocator;

const Map = @import("map.zig").Map;
const Heap = @import("Heap.zig");
const hash = @import("../utility/hash.zig");
const Actor = @import("Actor.zig");
const value = @import("value.zig");
const Object = @import("object.zig").Object;
const pointer = @import("../utility/pointer.zig");
const Selector = @import("Selector.zig");
const MapObject = @import("object.zig").MapObject;
const ObjectType = @import("object.zig").ObjectType;
const LookupResult = @import("object_lookup.zig").LookupResult;
const VirtualMachine = @import("VirtualMachine.zig");

/// A shaped object makes it easy to define an object with well-known slots for
/// use in primitives. The values can currently only be constants. This function
Expand Down
1 change: 0 additions & 1 deletion src/runtime/map_builder.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const Slot = @import("slot.zig").Slot;
const Value = @import("value.zig").Value;
const AstGen = @import("bytecode/AstGen.zig");
const context = @import("context.zig");
const VirtualMachine = @import("VirtualMachine.zig");

pub const AssignableSlotValues = std.BoundedArray(Value, AstGen.MaximumAssignableSlots);

Expand Down
1 change: 0 additions & 1 deletion src/runtime/object_bless.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const Value = @import("value.zig").Value;
const BaseObject = @import("base_object.zig").BaseObject;
const context = @import("context.zig");
const traversal = @import("object_traversal.zig");
const VirtualMachine = @import("VirtualMachine.zig");

const SeenObjectsSet = std.AutoHashMap([*]u64, void);
const RequiredMemoryCalculator = struct {
Expand Down
3 changes: 0 additions & 3 deletions src/runtime/object_lookup.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
// SPDX-License-Identifier: GPL-3.0-only

const std = @import("std");
const Allocator = std.mem.Allocator;

const hash = @import("../utility/hash.zig");
const Value = @import("value.zig").Value;
const Object = @import("object.zig").Object;
const ActorObject = @import("objects/actor.zig").Actor;
const MethodObject = @import("objects/method.zig").Method;
const VirtualMachine = @import("VirtualMachine.zig");

/// The result of a lookup operation.
pub const LookupResult = union(enum) {
Expand Down
2 changes: 0 additions & 2 deletions src/runtime/object_traversal.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
//
// SPDX-License-Identifier: GPL-3.0-only

const Map = @import("map.zig").Map;
const Slot = @import("slot.zig").Slot;
const Value = @import("value.zig").Value;
const Object = @import("object.zig").Object;
const MapObject = @import("object.zig").MapObject;

const TraverseObjectGraphLink = struct {
Expand Down
1 change: 0 additions & 1 deletion src/runtime/objects/activation.zig
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const SlotsObject = slots.Slots;
const GenericValue = value_import.Value;
const value_import = @import("../value.zig");
const LookupResult = @import("../object_lookup.zig").LookupResult;
const VirtualMachine = @import("../VirtualMachine.zig");
const exceedsBoundsOf = @import("../../utility/bounds_check.zig").exceedsBoundsOf;
const SlotsLikeObjectBase = slots.SlotsLikeObjectBase;

Expand Down
3 changes: 0 additions & 3 deletions src/runtime/objects/actor.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ const GenericValue = value_import.Value;
const PointerValue = value_import.PointerValue;
const value_import = @import("../value.zig");
const LookupResult = @import("../object_lookup.zig").LookupResult;
const VirtualMachine = @import("../VirtualMachine.zig");

const LOOKUP_DEBUG = debug.LOOKUP_DEBUG;

/// An actor object which is the object that the genesis actor interacts with in
/// Self code.
Expand Down
1 change: 0 additions & 1 deletion src/runtime/objects/actor_proxy.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const ActorObject = @import("actor.zig").Actor;
const GenericValue = value_import.Value;
const value_import = @import("../value.zig");
const LookupResult = @import("../object_lookup.zig").LookupResult;
const VirtualMachine = @import("../VirtualMachine.zig");

const LOOKUP_DEBUG = debug.LOOKUP_DEBUG;

Expand Down
1 change: 0 additions & 1 deletion src/runtime/objects/array.zig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const IntegerValue = value_import.IntegerValue;
const GenericValue = @import("../value.zig").Value;
const LookupResult = @import("../object_lookup.zig").LookupResult;
const value_import = @import("../value.zig");
const VirtualMachine = @import("../VirtualMachine.zig");

const LOOKUP_DEBUG = debug.LOOKUP_DEBUG;

Expand Down
1 change: 0 additions & 1 deletion src/runtime/objects/block.zig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const SourceRange = @import("../SourceRange.zig");
const LookupResult = @import("../object_lookup.zig").LookupResult;
const value_import = @import("../value.zig");
const ExecutableMap = @import("executable_map.zig").ExecutableMap;
const VirtualMachine = @import("../VirtualMachine.zig");
const ActivationObject = @import("activation.zig").Activation;
const SlotsLikeMapBase = slots.SlotsLikeMapBase;
const SlotsLikeObjectBase = slots.SlotsLikeObjectBase;
Expand Down
1 change: 0 additions & 1 deletion src/runtime/objects/byte_array.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const VMByteArray = @import("../ByteArray.zig");
const value_import = @import("../value.zig");
const GenericValue = value_import.Value;
const LookupResult = @import("../object_lookup.zig").LookupResult;
const VirtualMachine = @import("../VirtualMachine.zig");

const LOOKUP_DEBUG = debug.LOOKUP_DEBUG;

Expand Down
2 changes: 0 additions & 2 deletions src/runtime/objects/executable_map.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ const std = @import("std");
const Allocator = std.mem.Allocator;

const Map = @import("../map.zig").Map;
const Value = value_import.Value;
const Object = @import("../object.zig").Object;
const MapType = @import("../map.zig").MapType;
const bytecode = @import("../bytecode.zig");
const SlotsMap = @import("slots.zig").SlotsMap;
Expand Down
1 change: 0 additions & 1 deletion src/runtime/objects/intrinsic/addrinfo.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const Heap = @import("../../Heap.zig");
const Actor = @import("../../Actor.zig");
const Value = @import("../../value.zig").Value;
const IntrinsicMap = @import("../../intrinsic_map.zig").IntrinsicMap;
const VirtualMachine = @import("../../VirtualMachine.zig");
const ByteArrayObject = @import("../byte_array.zig").ByteArray;

/// The addrinfo object is used by the _GetAddrInfoForHost:... primitive to
Expand Down
1 change: 0 additions & 1 deletion src/runtime/objects/managed.zig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const Selector = @import("../Selector.zig");
const value_import = @import("../value.zig");
const GenericValue = value_import.Value;
const LookupResult = @import("../object_lookup.zig").LookupResult;
const VirtualMachine = @import("../VirtualMachine.zig");

const LOOKUP_DEBUG = debug.LOOKUP_DEBUG;

Expand Down
1 change: 0 additions & 1 deletion src/runtime/objects/method.zig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const GenericValue = value_import.Value;
const value_import = @import("../value.zig");
const LookupResult = @import("../object_lookup.zig").LookupResult;
const ExecutableMap = @import("executable_map.zig").ExecutableMap;
const VirtualMachine = @import("../VirtualMachine.zig");
const ActivationObject = @import("activation.zig").Activation;
const SlotsLikeMapBase = slots.SlotsLikeMapBase;
const SlotsLikeObjectBase = slots.SlotsLikeObjectBase;
Expand Down
1 change: 0 additions & 1 deletion src/runtime/objects/slots.zig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const MapObject = @import("../object.zig").MapObject;
const BaseObject = @import("../base_object.zig").BaseObject;
const MapBuilder = @import("../map_builder.zig").MapBuilder;
const LookupResult = @import("../object_lookup.zig").LookupResult;
const VirtualMachine = @import("../VirtualMachine.zig");

const SLOTS_LOOKUP_DEBUG = debug.SLOTS_LOOKUP_DEBUG;

Expand Down
2 changes: 0 additions & 2 deletions src/runtime/primitives/actor.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

const std = @import("std");

const Heap = @import("../Heap.zig");
const Actor = @import("../Actor.zig");
const Value = @import("../value.zig").Value;
const bless = @import("../object_bless.zig");
Expand All @@ -14,7 +13,6 @@ const SourceRange = @import("../SourceRange.zig");
const stack_trace = @import("../stack_trace.zig");
const MethodObject = @import("../objects/method.zig").Method;
const RuntimeError = @import("../RuntimeError.zig");
const VirtualMachine = @import("../VirtualMachine.zig");
const ExecutionResult = @import("../execution_result.zig").ExecutionResult;
const ActorProxyObject = @import("../objects/actor_proxy.zig").ActorProxy;
const PrimitiveContext = @import("../primitives.zig").PrimitiveContext;
Expand Down
2 changes: 0 additions & 2 deletions src/runtime/primitives/array.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
// SPDX-License-Identifier: GPL-3.0-only

const std = @import("std");
const Allocator = std.mem.Allocator;

const Heap = @import("../Heap.zig");
const Value = @import("../value.zig").Value;
const traversal = @import("../object_traversal.zig");
const BaseObject = @import("../base_object.zig").BaseObject;
Expand Down
3 changes: 0 additions & 3 deletions src/runtime/primitives/basic.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
// SPDX-License-Identifier: GPL-3.0-only

const std = @import("std");
const Allocator = std.mem.Allocator;

const Heap = @import("../Heap.zig");
const Script = @import("../../language/Script.zig");
const AstGen = @import("../bytecode/AstGen.zig");
const CodeGen = @import("../bytecode/CodeGen.zig");
const Selector = @import("../Selector.zig");
const interpreter = @import("../interpreter.zig");
const RuntimeError = @import("../RuntimeError.zig");
const ExecutionResult = @import("../execution_result.zig").ExecutionResult;
const error_set_utils = @import("../../utility/error_set.zig");
const PrimitiveContext = @import("../primitives.zig").PrimitiveContext;

const stack_trace = @import("../stack_trace.zig");
Expand Down
1 change: 0 additions & 1 deletion src/runtime/primitives/byte_array.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: GPL-3.0-only

const std = @import("std");
const Allocator = std.mem.Allocator;

const Value = @import("../value.zig").Value;
const ByteArray = @import("../ByteArray.zig");
Expand Down
1 change: 0 additions & 1 deletion src/runtime/primitives/object.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
const std = @import("std");
const Allocator = std.mem.Allocator;

const Object = @import("../object.zig").Object;
const SlotsObject = @import("../objects/slots.zig").Slots;
const RuntimeError = @import("../RuntimeError.zig");
const value_inspector = @import("../value_inspector.zig");
Expand Down
5 changes: 0 additions & 5 deletions src/runtime/primitives/system_call.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,16 @@

const std = @import("std");

const Heap = @import("../Heap.zig");
const Value = value_import.Value;
const Selector = @import("../Selector.zig");
const ByteArray = @import("../ByteArray.zig");
const AddrInfoMap = addrinfo_object.AddrInfoMap;
const SlotsObject = @import("../objects/slots.zig").Slots;
const array_object = @import("../objects/array.zig");
const value_import = @import("../value.zig");
const RuntimeError = @import("../RuntimeError.zig");
const ManagedObject = @import("../objects/managed.zig").Managed;
const AddrInfoObject = addrinfo_object.AddrInfo;
const FileDescriptor = @import("../objects/managed.zig").FileDescriptor;
const ByteArrayObject = @import("../objects/byte_array.zig").ByteArray;
const ExecutionResult = @import("../execution_result.zig").ExecutionResult;
const value_inspector = @import("../value_inspector.zig");
const addrinfo_object = @import("../objects/intrinsic/addrinfo.zig");
const exceedsBoundsOf = @import("../../utility/bounds_check.zig").exceedsBoundsOf;

Expand Down
2 changes: 0 additions & 2 deletions src/runtime/slot.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

const builtin = @import("builtin");
const std = @import("std");
const Allocator = std.mem.Allocator;

const AST = @import("../language/ast.zig");
const Heap = @import("./Heap.zig");
const hash = @import("../utility/hash.zig");
const Value = @import("./value.zig").Value;
Expand Down
1 change: 0 additions & 1 deletion src/runtime/stack_trace.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: GPL-3.0-only

const std = @import("std");
const Allocator = std.mem.Allocator;

const Activation = @import("./Activation.zig");
const SourceRange = @import("./SourceRange.zig");
Expand Down
3 changes: 0 additions & 3 deletions src/runtime/value.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const builtin = @import("builtin");
const Allocator = std.mem.Allocator;

const Map = @import("map.zig").Map;
const hash = @import("../utility/hash.zig");
const Heap = @import("./Heap.zig");
const Actor = @import("./Actor.zig");
const debug = @import("../debug.zig");
Expand All @@ -19,8 +18,6 @@ const ByteArray = @import("./ByteArray.zig");
const BaseObject = @import("base_object.zig").BaseObject;
const LookupResult = object_lookup.LookupResult;
const object_lookup = @import("object_lookup.zig");
const VirtualMachine = @import("./VirtualMachine.zig");
const InterpreterContext = @import("./interpreter.zig").InterpreterContext;

const LOOKUP_DEBUG = debug.LOOKUP_DEBUG;

Expand Down
1 change: 0 additions & 1 deletion src/runtime/value_inspector.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
const std = @import("std");
const Allocator = std.mem.Allocator;

const Slot = @import("./slot.zig").Slot;
const Object = @import("./object.zig").Object;
const Value = @import("./value.zig").Value;
const VirtualMachine = @import("./VirtualMachine.zig");
Expand Down
2 changes: 0 additions & 2 deletions src/utility/pointer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

//! Heap pointer utilities.

const builtin = @import("builtin");

const IsConst = enum { Mutable, Const };

/// Return a heap-aligned pointer.
Expand Down

0 comments on commit 14aa1c9

Please sign in to comment.