...
This commit is contained in:
@@ -12,6 +12,7 @@ const string BIN_DIR = "bin";
|
||||
const string INT_DIR = "bin-int";
|
||||
var INT_BUILTIN_DIR = Path.Join(INT_DIR, "builtin");
|
||||
var INT_OBJECT_DIR = Path.Join(INT_DIR, "obj");
|
||||
var INT_DEBUG_DIR = Path.Join(INT_DIR, "debug");
|
||||
|
||||
if (Directory.Exists(INT_DIR))
|
||||
{
|
||||
@@ -21,6 +22,7 @@ if (Directory.Exists(INT_DIR))
|
||||
Directory.CreateDirectory(BIN_DIR);
|
||||
Directory.CreateDirectory(INT_BUILTIN_DIR);
|
||||
Directory.CreateDirectory(INT_OBJECT_DIR);
|
||||
Directory.CreateDirectory(INT_DEBUG_DIR);
|
||||
|
||||
var options = new Options();
|
||||
|
||||
@@ -116,14 +118,20 @@ var objectFiles = new List<string>();
|
||||
|
||||
foreach (var file in options.Files)
|
||||
{
|
||||
var outFileName = $"{HexString.CreateUnique(8)}_{Path.GetFileNameWithoutExtension(file)}";
|
||||
|
||||
var ssa = QBEGenerator.Emit(boundSyntaxTrees[file], boundDefinitionTable);
|
||||
File.WriteAllText(Path.Join(INT_DEBUG_DIR, $"{outFileName}.ssa"), ssa);
|
||||
|
||||
var asm = await QBE.Invoke(ssa);
|
||||
if (asm == null)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
var fileName = Path.Join(INT_OBJECT_DIR, $"{HexString.CreateUnique(8)}_{Path.GetFileNameWithoutExtension(file)}.o");
|
||||
File.WriteAllText(Path.Join(INT_DEBUG_DIR, $"{outFileName}.s"), asm);
|
||||
|
||||
var fileName = Path.Join(INT_OBJECT_DIR, $"{outFileName}.o");
|
||||
var asmSuccess = await GCC.Assemble(asm, fileName);
|
||||
if (!asmSuccess)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user