Fixed exception and removed scripts

This commit is contained in:
Rafał Grodziński
2025-06-21 17:34:05 +09:00
parent 1da1622b8a
commit ac6f3c449a
4 changed files with 9 additions and 18 deletions

View File

@@ -1,6 +0,0 @@
#!/bin/bash
rm -f brb
rm -f *.o
rm -f *.asm
rm -rf *.dSYM

View File

@@ -1,6 +0,0 @@
#!/bin/bash
IFLAGS="-I/usr/local/opt/llvm/include -I/opt/homebrew/opt/llvm/include"
LDFLAGS="-L/usr/local/opt/llvm/lib -L/opt/homebrew/opt/llvm/lib"
cc -g -std=c++17 -lc++ -lllvm -DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1 ${LDFLAGS} ${IFLAGS} src/*.cpp -o brb

View File

@@ -149,10 +149,13 @@ string StatementReturn::toString(int indent) {
string value;
for (int ind=0; ind<indent; ind++)
value += " ";
value += "RETURN:\n";
for (int ind=0; ind<indent+1; ind++)
value += " ";
value += expression->toString(indent+1);
value += "RETURN";
if (expression != nullptr) {
value += ":\n";
for (int ind=0; ind<indent+1; ind++)
value += " ";
value += expression->toString(indent+1);
}
value += "\n";
return value;
}

View File

@@ -80,8 +80,8 @@ int main(int argc, char **argv) {
module->print(llvm::outs(), nullptr);
}
//CodeGenerator codeGenerator(module);
//codeGenerator.generateObjectFile(outputKind);
CodeGenerator codeGenerator(module);
codeGenerator.generateObjectFile(outputKind);
return 0;
}