Skip to content

Commit

Permalink
Merge pull request #394 from Verdagon/master
Browse files Browse the repository at this point in the history
Made scope tethers crash instead of using the undead cycle.
  • Loading branch information
Verdagon authored Dec 11, 2021
2 parents dae0bfd + ffca9bd commit 38fd362
Show file tree
Hide file tree
Showing 23 changed files with 118 additions and 1,941 deletions.
6 changes: 6 additions & 0 deletions Driver/src/build.vale
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ fn build_stuff(compiler_dir &Path, all_args &Array<imm, final, str>) {
"Whether to output VPST.",
"false",
"Whether to output VPST, the code's parsed representation"),
Flag(
"--llvm_ir",
FLAG_BOOL(),
"Whether to output LLVM IR.",
"false",
"Whether to output LLVM IR."),
Flag(
"--reuse_vast",
FLAG_BOOL(),
Expand Down
6 changes: 3 additions & 3 deletions Driver/src/midas.vale
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ Subprocess {

command_line_args = List<str>();
command_line_args!.add("--verify");
command_line_args!.add("--output-dir");
command_line_args!.add("--output_dir");
command_line_args!.add(output_dir.str());

if (not maybe_region_override.isEmpty()) {
command_line_args!.add("--region-override");
command_line_args!.add("--region_override");
command_line_args!.add(maybe_region_override.get());
}
if (not maybe_cpu.isEmpty()) {
Expand All @@ -48,7 +48,7 @@ Subprocess {
command_line_args!.add("--verify");
}
if (llvm_ir) {
command_line_args!.add("--llvm_ir");
command_line_args!.add("--llvmir");
}
if (print_mem_overhead) {
command_line_args!.add("--print_mem_overhead");
Expand Down
191 changes: 0 additions & 191 deletions Midas/src/builtins/genHeap.c

This file was deleted.

76 changes: 0 additions & 76 deletions Midas/src/builtins/twinpages.c

This file was deleted.

2 changes: 1 addition & 1 deletion Midas/src/c-compiler/externs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Externs::Externs(LLVMModuleRef mod, LLVMContextRef context) {
memcpy = addExtern(mod, "memcpy", int8PtrLT, {int8PtrLT, int8PtrLT, int64LT});
memset = addExtern(mod, "memset", voidLT, {int8PtrLT, int8LT, int64LT});

initTwinPages = addExtern(mod, "__vale_initTwinPages", int8PtrLT, {});
// initTwinPages = addExtern(mod, "__vale_initTwinPages", int8PtrLT, {});
}

bool hasEnding (std::string const &fullString, std::string const &ending) {
Expand Down
2 changes: 1 addition & 1 deletion Midas/src/c-compiler/externs.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Externs {
LLVMValueRef strncpy = nullptr;
LLVMValueRef memcpy = nullptr;

LLVMValueRef initTwinPages = nullptr;
// LLVMValueRef initTwinPages = nullptr;
LLVMValueRef censusContains = nullptr;
LLVMValueRef censusAdd = nullptr;
LLVMValueRef censusRemove = nullptr;
Expand Down
1 change: 1 addition & 0 deletions Midas/src/c-compiler/function/expressions/externs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ Ref buildExternCall(
auto result = LLVMBuildFAdd(builder, leftLE, rightLE, "add");
return wrap(globalState->getRegion(globalState->metalCache->floatRef), globalState->metalCache->floatRef, result);
} else if (prototype->name->name == "__vbi_panic") {
buildPrint(globalState, builder, "(panic)\n");
// See MPESC for status codes
auto exitCodeLE = makeConstIntExpr(functionState, builder, LLVMInt64TypeInContext(globalState->context), 1);
LLVMBuildCall(builder, globalState->externs->exit, &exitCodeLE, 1, "");
Expand Down
2 changes: 1 addition & 1 deletion Midas/src/c-compiler/globalstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class GlobalState {
LLVMTypeRef lgtTableStructLT, lgtEntryStructLT = nullptr; // contains generation and next free
LLVMValueRef expandLgt = nullptr, checkLgti = nullptr, getNumLiveLgtEntries = nullptr;

LLVMValueRef genMalloc = nullptr, genFree = nullptr;
// LLVMValueRef genMalloc = nullptr, genFree = nullptr;

LLVMTypeRef concreteHandleLT = nullptr; // 24 bytes, for SSA, RSA, and structs
LLVMTypeRef interfaceHandleLT = nullptr; // 32 bytes, for interfaces. concreteHandleLT plus 8b itable ptr.
Expand Down
Loading

0 comments on commit 38fd362

Please sign in to comment.