Merge remote-tracking branch 'origin/85-implement-llvm-backend' into 85-implement-llvm-backend
This commit is contained in:
commit
b843a9aa79
|
@ -4,6 +4,7 @@
|
|||
#include <llvm-c/Target.h>
|
||||
#include <llvm-c/TargetMachine.h>
|
||||
#include <llvm-c/Types.h>
|
||||
#include <llvm-c/Analysis.h>
|
||||
#include <llvm/backend.h>
|
||||
#include <llvm/parser.h>
|
||||
#include <llvm/llvm-ir/types.h>
|
||||
|
@ -205,6 +206,15 @@ static BackendError build_module(LLVMBackendCompileUnit* unit,
|
|||
// TODO: implement functions
|
||||
err = impl_functions(unit, global_scope, module->functions);
|
||||
|
||||
char* error = NULL;
|
||||
LLVMVerifyModule(unit->module, LLVMAbortProcessAction, &error);
|
||||
|
||||
if (error) {
|
||||
print_message(Error, "Unable to compile due to: %s", error);
|
||||
LLVMDisposeMessage(error);
|
||||
err = new_backend_impl_error(Implementation, NULL, "LLVM backend verification error, see stdout");
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue