aboutsummaryrefslogtreecommitdiffstats
path: root/examples/ExceptionDemo
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2015-03-23 12:10:34 -0700
committerStephen Hines <srhines@google.com>2015-03-23 12:10:34 -0700
commitebe69fe11e48d322045d5949c83283927a0d790b (patch)
treec92f1907a6b8006628a4b01615f38264d29834ea /examples/ExceptionDemo
parentb7d2e72b02a4cb8034f32f8247a2558d2434e121 (diff)
downloadexternal_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.zip
external_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.tar.gz
external_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.tar.bz2
Update aosp/master LLVM for rebase to r230699.
Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9
Diffstat (limited to 'examples/ExceptionDemo')
-rw-r--r--examples/ExceptionDemo/ExceptionDemo.cpp41
1 files changed, 18 insertions, 23 deletions
diff --git a/examples/ExceptionDemo/ExceptionDemo.cpp b/examples/ExceptionDemo/ExceptionDemo.cpp
index 17076fa..317a326 100644
--- a/examples/ExceptionDemo/ExceptionDemo.cpp
+++ b/examples/ExceptionDemo/ExceptionDemo.cpp
@@ -56,8 +56,8 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
-#include "llvm/PassManager.h"
#include "llvm/Support/Dwarf.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Target/TargetOptions.h"
@@ -1122,14 +1122,11 @@ static llvm::BasicBlock *createCatchBlock(llvm::LLVMContext &context,
/// @param numExceptionsToCatch length of exceptionTypesToCatch array
/// @param exceptionTypesToCatch array of type info types to "catch"
/// @returns generated function
-static
-llvm::Function *createCatchWrappedInvokeFunction(llvm::Module &module,
- llvm::IRBuilder<> &builder,
- llvm::FunctionPassManager &fpm,
- llvm::Function &toInvoke,
- std::string ourId,
- unsigned numExceptionsToCatch,
- unsigned exceptionTypesToCatch[]) {
+static llvm::Function *createCatchWrappedInvokeFunction(
+ llvm::Module &module, llvm::IRBuilder<> &builder,
+ llvm::legacy::FunctionPassManager &fpm, llvm::Function &toInvoke,
+ std::string ourId, unsigned numExceptionsToCatch,
+ unsigned exceptionTypesToCatch[]) {
llvm::LLVMContext &context = module.getContext();
llvm::Function *toPrint32Int = module.getFunction("print32Int");
@@ -1389,13 +1386,11 @@ llvm::Function *createCatchWrappedInvokeFunction(llvm::Module &module,
/// @param nativeThrowFunct function which will throw a foreign exception
/// if the above nativeThrowType matches generated function's arg.
/// @returns generated function
-static
-llvm::Function *createThrowExceptionFunction(llvm::Module &module,
- llvm::IRBuilder<> &builder,
- llvm::FunctionPassManager &fpm,
- std::string ourId,
- int32_t nativeThrowType,
- llvm::Function &nativeThrowFunct) {
+static llvm::Function *
+createThrowExceptionFunction(llvm::Module &module, llvm::IRBuilder<> &builder,
+ llvm::legacy::FunctionPassManager &fpm,
+ std::string ourId, int32_t nativeThrowType,
+ llvm::Function &nativeThrowFunct) {
llvm::LLVMContext &context = module.getContext();
namedValues.clear();
ArgTypes unwindArgTypes;
@@ -1508,10 +1503,10 @@ static void createStandardUtilityFunctions(unsigned numTypeInfos,
/// @param nativeThrowFunctName name of external function which will throw
/// a foreign exception
/// @returns outermost generated test function.
-llvm::Function *createUnwindExceptionTest(llvm::Module &module,
- llvm::IRBuilder<> &builder,
- llvm::FunctionPassManager &fpm,
- std::string nativeThrowFunctName) {
+llvm::Function *
+createUnwindExceptionTest(llvm::Module &module, llvm::IRBuilder<> &builder,
+ llvm::legacy::FunctionPassManager &fpm,
+ std::string nativeThrowFunctName) {
// Number of type infos to generate
unsigned numTypeInfos = 6;
@@ -1961,17 +1956,17 @@ int main(int argc, char *argv[]) {
llvm::make_unique<llvm::Module>("my cool jit", context);
llvm::Module *module = Owner.get();
- llvm::RTDyldMemoryManager *MemMgr = new llvm::SectionMemoryManager();
+ std::unique_ptr<llvm::RTDyldMemoryManager> MemMgr(new llvm::SectionMemoryManager());
// Build engine with JIT
llvm::EngineBuilder factory(std::move(Owner));
factory.setEngineKind(llvm::EngineKind::JIT);
factory.setTargetOptions(Opts);
- factory.setMCJITMemoryManager(MemMgr);
+ factory.setMCJITMemoryManager(std::move(MemMgr));
llvm::ExecutionEngine *executionEngine = factory.create();
{
- llvm::FunctionPassManager fpm(module);
+ llvm::legacy::FunctionPassManager fpm(module);
// Set up the optimizer pipeline.
// Start with registering info about how the