diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-04-22 04:24:43 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-04-22 04:24:43 +0000 |
commit | 337b35ae29e96f4b4a13c9636521b0eb8765905e (patch) | |
tree | c4beb74148686e3506c85c504bef701ba670e6c5 /examples/ExceptionDemo | |
parent | 459448abccc55aeabe422b270bcabe6357a34b2e (diff) |
Fix up Exception demo from recent opaque pointer type changes to GEP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235478 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples/ExceptionDemo')
-rw-r--r-- | examples/ExceptionDemo/ExceptionDemo.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/ExceptionDemo/ExceptionDemo.cpp b/examples/ExceptionDemo/ExceptionDemo.cpp index fed42b7c2bc..81337c4823b 100644 --- a/examples/ExceptionDemo/ExceptionDemo.cpp +++ b/examples/ExceptionDemo/ExceptionDemo.cpp @@ -1293,10 +1293,11 @@ static llvm::Function *createCatchWrappedInvokeFunction( // (_Unwind_Exception instance). This member tells us whether or not // the exception is foreign. llvm::Value *unwindExceptionClass = - builder.CreateLoad(builder.CreateStructGEP( - builder.CreatePointerCast(unwindException, - ourUnwindExceptionType->getPointerTo()), - 0)); + builder.CreateLoad(builder.CreateStructGEP( + ourUnwindExceptionType, + builder.CreatePointerCast(unwindException, + ourUnwindExceptionType->getPointerTo()), + 0)); // Branch to the externalExceptionBlock if the exception is foreign or // to a catch router if not. Either way the finally block will be run. @@ -1336,10 +1337,10 @@ static llvm::Function *createCatchWrappedInvokeFunction( // // Note: Index is not relative to pointer but instead to structure // unlike a true getelementptr (GEP) instruction - typeInfoThrown = builder.CreateStructGEP(typeInfoThrown, 0); + typeInfoThrown = builder.CreateStructGEP(ourExceptionType, typeInfoThrown, 0); llvm::Value *typeInfoThrownType = - builder.CreateStructGEP(typeInfoThrown, 0); + builder.CreateStructGEP(builder.getInt8PtrTy(), typeInfoThrown, 0); generateIntegerPrint(context, module, |