#include "llvm/IR/Verifier.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/GenericValue.h"
+#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
int n = argc > 1 ? atol(argv[1]) : 24;
InitializeNativeTarget();
+ InitializeNativeTargetAsmPrinter();
LLVMContext Context;
// Create some module to put our function into it.
std::unique_ptr<Module> First = std::move(Modules[0]);
Modules.clear();
+ if (First->getDataLayout().isDefault())
+ First->setDataLayout(getDataLayout());
+
OwnedModules.addModule(std::move(First));
RegisterJITEventListener(JITEventListener::createGDBRegistrationListener());
}
void MCJIT::addModule(std::unique_ptr<Module> M) {
MutexGuard locked(lock);
+
+ if (M->getDataLayout().isDefault())
+ M->setDataLayout(getDataLayout());
+
OwnedModules.addModule(std::move(M));
}
if (ObjCache)
ObjectToLoad = ObjCache->getObject(M);
- if (M->getDataLayout().isDefault()) {
- M->setDataLayout(getDataLayout());
- } else {
- assert(M->getDataLayout() == getDataLayout() && "DataLayout Mismatch");
- }
+ assert(M->getDataLayout() == getDataLayout() && "DataLayout Mismatch");
// If the cache did not contain a suitable object, compile the object
if (!ObjectToLoad) {
assert(F && "Function *F was null at entry to run()");
void *FPtr = getPointerToFunction(F);
+ finalizeModule(F->getParent());
assert(FPtr && "Pointer to fn's code was null after getPointerToFunction");
FunctionType *FTy = F->getFunctionType();
Type *RetTy = FTy->getReturnType();