Commit 031ca77f authored by Naman Dixit's avatar Naman Dixit

Removed comments from old complicated interpreter

parent 8eb0ee24
...@@ -282,11 +282,9 @@ int demo (void) ...@@ -282,11 +282,9 @@ int demo (void)
errno = 0; errno = 0;
// llvm::FunctionCallee Exit = Mod->getOrInsertFunction("exit", { // Execute
// llvm::Type::getVoidTy(Context), // Run static constructors.
// llvm::Type::getInt32Ty(Context));
EE->runStaticConstructorsDestructors(false); EE->runStaticConstructorsDestructors(false);
// (void)EE->getPointerToFunction(EntryFn);
// Run main. // Run main.
llvm::GenericValue Result = EE->runFunction(EntryFn, llvm::ArrayRef<llvm::GenericValue>()); llvm::GenericValue Result = EE->runFunction(EntryFn, llvm::ArrayRef<llvm::GenericValue>());
...@@ -296,23 +294,7 @@ int demo (void) ...@@ -296,23 +294,7 @@ int demo (void)
EE->runStaticConstructorsDestructors(true); EE->runStaticConstructorsDestructors(true);
std::cout << "Returns: " << ResultValue << std::endl; std::cout << "Returns: " << ResultValue << std::endl;
}
// if (llvm::Function *ExitF =
// llvm::dyn_cast<llvm::Function>(Exit.getCallee()->stripPointerCasts())) {
// if (ExitF->getFunctionType() == Exit.getFunctionType()) {
// std::vector<llvm::GenericValue> Args;
// llvm::GenericValue ResultGV;
// ResultGV.IntVal = llvm::APInt(32, static_cast<uint64_t>(Result));
// Args.push_back(ResultGV);
// EE->runFunction(ExitF, Args);
// llvm::WithColor::error(llvm::errs(), code_name.c_str())
// << "exit(" << Result << ") returned!\n";
// abort();
// }
// llvm::WithColor::error(llvm::errs(), code_name.c_str()) << "exit defined with wrong prototype!\n";
// abort();
// }
return static_cast<int>(ResultValue); return static_cast<int>(ResultValue);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment