diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2025-06-07 04:51:26 -0400 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2025-06-12 13:55:41 +0100 |
| commit | c95b1bf2d3c3ae7595e15ad521952b77d5063801 (patch) | |
| tree | a1260ddf1454688e6732a22a6e3c4cc60bd81986 /lib/std | |
| parent | c4ec382fc806e0cb4484c1cb2edcc5fc40c3c9d8 (diff) | |
| download | zig-c95b1bf2d3c3ae7595e15ad521952b77d5063801.tar.gz zig-c95b1bf2d3c3ae7595e15ad521952b77d5063801.zip | |
x86_64: remove air references from mir
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/zig/Zir.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/std/zig/Zir.zig b/lib/std/zig/Zir.zig index 440b4df9fc..17643e6f1e 100644 --- a/lib/std/zig/Zir.zig +++ b/lib/std/zig/Zir.zig @@ -4861,6 +4861,15 @@ pub fn getParamBody(zir: Zir, fn_inst: Inst.Index) []const Zir.Inst.Index { } } +pub fn getParamName(zir: Zir, param_inst: Inst.Index) ?NullTerminatedString { + const inst = zir.instructions.get(@intFromEnum(param_inst)); + return switch (inst.tag) { + .param, .param_comptime => zir.extraData(Inst.Param, inst.data.pl_tok.payload_index).data.name, + .param_anytype, .param_anytype_comptime => inst.data.str_tok.start, + else => null, + }; +} + pub fn getFnInfo(zir: Zir, fn_inst: Inst.Index) FnInfo { const tags = zir.instructions.items(.tag); const datas = zir.instructions.items(.data); |
