Assert that the value returned by FunctionPrototype bitcode emitter is a llvm::Function.
This commit is contained in:
parent
408df71461
commit
3278f12028
|
@ -28,6 +28,7 @@
|
||||||
#include <llvm/IR/LLVMContext.h>
|
#include <llvm/IR/LLVMContext.h>
|
||||||
#include <llvm/IR/Module.h>
|
#include <llvm/IR/Module.h>
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -552,6 +553,7 @@ bool BitcodeEmitter::emit(Function const& node) {
|
||||||
llvm::Function *func = dynamic_cast<llvm::Function*>(d->retval);
|
llvm::Function *func = dynamic_cast<llvm::Function*>(d->retval);
|
||||||
|
|
||||||
d->scope.enter();
|
d->scope.enter();
|
||||||
|
assert(func != nullptr);
|
||||||
|
|
||||||
llvm::BasicBlock *bb = llvm::BasicBlock::Create(
|
llvm::BasicBlock *bb = llvm::BasicBlock::Create(
|
||||||
getGlobalContext(), "entry", func
|
getGlobalContext(), "entry", func
|
||||||
|
|
Reference in New Issue
Block a user