summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-04-22 04:24:43 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-04-22 04:24:43 +0000
commit83a20fab61e43972370691ced3b3d755a8667334 (patch)
treefa5c5958bf2f2574c8cf08f3baa0595b1ee568e8
parentfe0cdf989939036bc70329bc3ced2ff25d975908 (diff)
downloadbcm5719-llvm-83a20fab61e43972370691ced3b3d755a8667334.tar.gz
bcm5719-llvm-83a20fab61e43972370691ced3b3d755a8667334.zip
Fix up Exception demo from recent opaque pointer type changes to GEP
llvm-svn: 235478
-rw-r--r--llvm/examples/ExceptionDemo/ExceptionDemo.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/examples/ExceptionDemo/ExceptionDemo.cpp b/llvm/examples/ExceptionDemo/ExceptionDemo.cpp
index fed42b7c2bc..81337c4823b 100644
--- a/llvm/examples/ExceptionDemo/ExceptionDemo.cpp
+++ b/llvm/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,
OpenPOWER on IntegriCloud