//
//===----------------------------------------------------------------------===//
-#include "llvm/Analysis/Verifier.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
#include "llvm/IR/DataLayout.h"
/// This function is the struct _Unwind_Exception API mandated delete function
/// used by foreign exception handlers when deleting our exception
/// (OurException), instances.
-/// @param reason @link http://mentorembedded.github.com/cxx-abi/abi-eh.html
+/// @param reason See @link http://mentorembedded.github.com/cxx-abi/abi-eh.html
/// @unlink
/// @param expToDelete exception instance to delete
void deleteFromUnwindOurException(_Unwind_Reason_Code reason,
return(outerCatchFunct);
}
-
+namespace {
/// Represents our foreign exceptions
class OurCppRunException : public std::runtime_error {
public:
std::runtime_error::operator=(toCopy)));
}
- ~OurCppRunException (void) throw () {}
+ virtual ~OurCppRunException (void) throw () {}
};
-
+} // end anonymous namespace
/// Throws foreign C++ exception.
/// @param ignoreIt unused parameter that allows function to match implied
// If not set, exception handling will not be turned on
llvm::TargetOptions Opts;
- Opts.JITExceptionHandling = true;
llvm::InitializeNativeTarget();
llvm::InitializeNativeTargetAsmPrinter();
// Make the module, which holds all the code.
llvm::Module *module = new llvm::Module("my cool jit", context);
- llvm::JITMemoryManager *MemMgr = new llvm::SectionMemoryManager();
+ llvm::RTDyldMemoryManager *MemMgr = new llvm::SectionMemoryManager();
// Build engine with JIT
llvm::EngineBuilder factory(module);
factory.setEngineKind(llvm::EngineKind::JIT);
factory.setAllocateGVsWithCode(false);
factory.setTargetOptions(Opts);
- factory.setJITMemoryManager(MemMgr);
+ factory.setMCJITMemoryManager(MemMgr);
factory.setUseMCJIT(true);
llvm::ExecutionEngine *executionEngine = factory.create();