...
This commit is contained in:
@@ -108,7 +108,9 @@ foreach (var compilationUnit in compilationUnits)
|
|||||||
}
|
}
|
||||||
|
|
||||||
var assembly = Assembly.GetExecutingAssembly();
|
var assembly = Assembly.GetExecutingAssembly();
|
||||||
var runtimeResources = assembly.GetManifestResourceNames().Where(name => name.EndsWith(".s", StringComparison.OrdinalIgnoreCase));
|
var runtimeResources = assembly
|
||||||
|
.GetManifestResourceNames()
|
||||||
|
.Where(name => name.EndsWith(".s", StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
foreach (var resourceName in runtimeResources)
|
foreach (var resourceName in runtimeResources)
|
||||||
{
|
{
|
||||||
@@ -188,8 +190,8 @@ static async Task<string> InvokeQBE(string ssa)
|
|||||||
|
|
||||||
static async Task InvokeAssembler(string asmPath, string objPath)
|
static async Task InvokeAssembler(string asmPath, string objPath)
|
||||||
{
|
{
|
||||||
using var asProcess = new Process();
|
using var gccProcess = new Process();
|
||||||
asProcess.StartInfo = new ProcessStartInfo("gcc", ["-c", asmPath, "-o", objPath])
|
gccProcess.StartInfo = new ProcessStartInfo("gcc", ["-c", asmPath, "-o", objPath])
|
||||||
{
|
{
|
||||||
UseShellExecute = false,
|
UseShellExecute = false,
|
||||||
RedirectStandardOutput = true,
|
RedirectStandardOutput = true,
|
||||||
@@ -197,16 +199,16 @@ static async Task InvokeAssembler(string asmPath, string objPath)
|
|||||||
CreateNoWindow = true
|
CreateNoWindow = true
|
||||||
};
|
};
|
||||||
|
|
||||||
asProcess.Start();
|
gccProcess.Start();
|
||||||
|
|
||||||
var asOutput = await asProcess.StandardOutput.ReadToEndAsync();
|
var gccOutput = await gccProcess.StandardOutput.ReadToEndAsync();
|
||||||
var asErrors = await asProcess.StandardError.ReadToEndAsync();
|
var gccErrors = await gccProcess.StandardError.ReadToEndAsync();
|
||||||
|
|
||||||
await asProcess.WaitForExitAsync();
|
await gccProcess.WaitForExitAsync();
|
||||||
|
|
||||||
if (asProcess.ExitCode != 0)
|
if (gccProcess.ExitCode != 0)
|
||||||
{
|
{
|
||||||
throw new Exception($"Assembler errors:\n{asErrors}");
|
throw new Exception($"Assembler errors:\n{gccErrors}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user