fix(dfr): add runtime termination call on compiler main exit.

This commit is contained in:
Antoniu Pop
2022-03-14 13:49:50 +00:00
committed by Ayoub Benaissa
parent 27318ff29a
commit 337a9bb5c2
4 changed files with 17 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
add_library(ConcretelangRuntime SHARED
context.cpp
wrappers.cpp
dfr_terminate.cpp
)
if(CONCRETELANG_PARALLEL_EXECUTION_ENABLED)

View File

@@ -344,7 +344,6 @@ int __wrap_main(int argc, char *argv[]) {
}
}
/**********************/
/* Debug interface. */
/**********************/

View File

@@ -0,0 +1,11 @@
// Part of the Concrete Compiler Project, under the BSD3 License with Zama
// Exceptions. See
// https://github.com/zama-ai/concrete-compiler-internal/blob/master/LICENSE.txt
// for license information.
#ifndef CONCRETELANG_PARALLEL_EXECUTION_ENABLED
#include <concretelang/Runtime/runtime_api.h>
void _dfr_terminate() {}
#endif

View File

@@ -29,6 +29,7 @@
#include "concretelang/Dialect/RT/IR/RTDialect.h"
#include "concretelang/Dialect/TFHE/IR/TFHEDialect.h"
#include "concretelang/Dialect/TFHE/IR/TFHETypes.h"
#include "concretelang/Runtime/runtime_api.h"
#include "concretelang/Support/Error.h"
#include "concretelang/Support/JitCompilerEngine.h"
#include "concretelang/Support/LLVMEmitFile.h"
@@ -480,8 +481,10 @@ mlir::LogicalResult compilerMain(int argc, char **argv) {
}
int main(int argc, char **argv) {
int result = 0;
if (mlir::failed(compilerMain(argc, argv)))
return 1;
result = 1;
return 0;
_dfr_terminate();
return result;
}