-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from Quickfall/qasm/ptr
[feat] removal of standart variables in QAsm in favor of Pointers
- Loading branch information
Showing
4 changed files
with
130 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* The writer of IR. Allows to compile Quickfall files into a lower level format than Assembly for speed. | ||
*/ | ||
|
||
#include <stdio.h> | ||
|
||
#include "./structs.h" | ||
#include "./ir.h" | ||
|
||
/** | ||
* Writes an IR block into the compiled Quickfall format. | ||
* @param block the block. | ||
* @param file the file stream. | ||
*/ | ||
void writeIRBlock(IR_BASIC_BLOCK* block, FILE* file) { | ||
fwrite(&block->instructionCount, sizeof(int), 1, file); | ||
|
||
for(int i = 0; i < block->instructionCount; ++i) { | ||
IR_INSTRUCTION* instruction = block->instructions[i]; | ||
|
||
fwrite(instruction->opCode, 1, 1, file); | ||
fwrite(instruction->paramCount, sizeof(int), 1, file); | ||
|
||
for(int i = 0; i < | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* The writer of IR. Allows to compile Quickfall files into a lower level format than Assembly for speed. | ||
*/ | ||
|
||
#include <stdio.h> | ||
|
||
#include "./structs.h" | ||
#include "./ir.h" | ||
|
||
#ifndef IR_WRITER_H | ||
#define IR_WRITER_H | ||
|
||
/** | ||
* Writes an IR block into the compiled Quickfall format. | ||
* @param block the block. | ||
* @param file the file stream. | ||
*/ | ||
void writeIRBlock(IR_BASIC_BLOCK* block, FILE* file); | ||
|
||
#endif |