diff --git a/Src/ILGPU/Backends/IL/ILEmitter.cs b/Src/ILGPU/Backends/IL/ILEmitter.cs
index 050e3ec5f..93fb92207 100644
--- a/Src/ILGPU/Backends/IL/ILEmitter.cs
+++ b/Src/ILGPU/Backends/IL/ILEmitter.cs
@@ -234,6 +234,12 @@ public interface IILEmitter
/// The jump targets.
void EmitSwitch(ILLabel[] labels);
+ ///
+ /// Emits code to write something to the console.
+ ///
+ /// The message to write.
+ void EmitWriteLine(string message);
+
///
/// Finishes the code generation process.
///
@@ -405,6 +411,10 @@ public void EmitSwitch(params ILLabel[] labels)
Generator.Emit(OpCodes.Switch, switchLabels);
}
+ ///
+ public void EmitWriteLine(string message) =>
+ Generator.EmitWriteLine(message);
+
///
public void Finish() { }
@@ -635,6 +645,10 @@ public void EmitSwitch(params ILLabel[] labels)
}
}
+ ///
+ public void EmitWriteLine(string message) =>
+ Writer.WriteLine($" => Write('{message}')");
+
///
public void Finish()
{
@@ -717,6 +731,9 @@ public void EmitConstant(double constant) { }
///
public void EmitSwitch(params ILLabel[] labels) { }
+ ///
+ public void EmitWriteLine(string message) { }
+
///
public void Finish() { }