authorgravatar for vallahor91@gmail.comVallahor <vallahor91@gmail.com> 2022-06-03 21:13:34-03:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-19 19:10:12-07:00
logf189e46b8e1ee7207febb667b79d2b8d1411f265
treed887875123713e9b3e8d3975708eab28634ebf43
parentf13db1ce18cb7626b664b14606223e16357416b4

autodoc: add some tags


2 files changed, 22 insertions(+), 1 deletions(-)

lib/docs/main.js+16-1
......@@ -1114,7 +1114,6 @@ var zigAnalysis;
11141114 return exprName(sliceIndex, opts);
11151115 }
11161116 case "cmpxchg":{
1117 console.log(expr);
11181117 const typeIndex = zigAnalysis.exprs[expr.cmpxchg.type];
11191118 const ptrIndex = zigAnalysis.exprs[expr.cmpxchg.ptr];
11201119 const expectedValueIndex = zigAnalysis.exprs[expr.cmpxchg.expected_value];
......@@ -1195,6 +1194,7 @@ var zigAnalysis;
11951194 const param_expr = zigAnalysis.exprs[expr.builtin.param];
11961195 let param = exprName(param_expr, opts);
11971196
1197
11981198 let payloadHtml = "@";
11991199 switch (expr.builtin.name) {
12001200 case "align_of": {
......@@ -1324,6 +1324,21 @@ var zigAnalysis;
13241324 case "bit_not": {
13251325 return "~" + param;
13261326 }
1327 case "clz": {
1328 return "@clz(T" + ", " + param + ")";
1329 }
1330 case "ctz": {
1331 return "@ctz(T" + ", " + param + ")";
1332 }
1333 case "pop_count": {
1334 return "@popCount(T" + ", " + param + ")";
1335 }
1336 case "byte_swap": {
1337 return "@byteSwap(T" + ", " + param + ")";
1338 }
1339 case "bit_reverse": {
1340 return "@bitReverse(T" + ", " + param + ")";
1341 }
13271342 default: console.log("builtin function not handled yet or doesn't exist!");
13281343 };
13291344 return payloadHtml + "(" + param + ")";
src/Autodoc.zig+6
......@@ -1357,6 +1357,12 @@ fn walkInstruction(
13571357 .minimum,
13581358 .maximum,
13591359 .bit_not,
1360 // @check
1361 .clz,
1362 .ctz,
1363 .pop_count,
1364 .byte_swap,
1365 .bit_reverse,
13601366 => {
13611367 const un_node = data[inst_index].un_node;
13621368 const bin_index = self.exprs.items.len;