Skip to content

Commit 096adcf

Browse files
committed
Remove unused code in QuickJS module generator.
1 parent 90ddc2d commit 096adcf

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

src/Generator/Generators/QuickJS/QuickJSModule.cs

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -64,31 +64,9 @@ public override void Process()
6464

6565
var moduleName = module.LibraryName;
6666

67-
// Generate JS module function list.
68-
WriteLine($"static const JSCFunctionListEntry js_{moduleName}_funcs[] =");
69-
WriteOpenBraceAndIndent();
70-
71-
// Foreach translation unit, write the generated functions.
72-
foreach (var unit in TranslationUnits)
73-
{
74-
var functionPrinter = new QuickJSModuleFunctionPrinter(Context);
75-
functionPrinter.Indent(CurrentIndentation);
76-
unit.Visit(functionPrinter);
77-
78-
Write(functionPrinter.Generate());
79-
}
80-
81-
Unindent();
82-
WriteLine("};");
83-
NewLine();
84-
8567
// Generate init function.
8668
WriteLine($"static int js_{moduleName}_init(JSContext* ctx, JSModuleDef* m)");
8769
WriteOpenBraceAndIndent();
88-
/*
89-
WriteLine($"return JS_SetModuleExportList(ctx, m, js_{moduleName}_funcs," +
90-
$" countof(js_{moduleName}_funcs));");
91-
*/
9270

9371
foreach (var unit in TranslationUnits)
9472
{
@@ -125,10 +103,6 @@ public override void Process()
125103
WriteLine($"register_{name}(ctx, m, /*set=*/false);");
126104
}
127105
NewLine();
128-
/*
129-
WriteLine($"JS_AddModuleExportList(ctx, m, js_{moduleName}_funcs," +
130-
$" countof(js_{moduleName}_funcs));");
131-
*/
132106

133107
WriteLine("return m;");
134108

@@ -152,32 +126,4 @@ public static string GetIncludeFileName(BindingContext context,
152126
return $"{file}.h";
153127
}
154128
}
155-
156-
public class QuickJSModuleFunctionPrinter : CCodeGenerator
157-
{
158-
public QuickJSModuleFunctionPrinter(BindingContext context)
159-
: base(context, null)
160-
{
161-
}
162-
163-
public override bool VisitTranslationUnit(TranslationUnit unit)
164-
{
165-
WriteLine($"// {QuickJSModule.GetIncludeFileName(Context, unit)}");
166-
167-
return base.VisitTranslationUnit(unit);
168-
}
169-
170-
public override bool VisitFunctionDecl(Function function)
171-
{
172-
if (!function.IsGenerated)
173-
return true;
174-
175-
/*
176-
WriteLine($"JS_CFUNC_DEF(\"{function.Name}\"," +
177-
$" {function.Parameters.Count}, js_{function.Name}),");
178-
*/
179-
180-
return true;
181-
}
182-
}
183129
}

0 commit comments

Comments
 (0)