[llvm-commits] [llvm] r135373 - /llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp

Chris Lattner sabre at nondot.org
Sun Jul 17 21:52:09 PDT 2011


Author: lattner
Date: Sun Jul 17 23:52:09 2011
New Revision: 135373

URL: http://llvm.org/viewvc/llvm-project?rev=135373&view=rev
Log:
update this to build with a recent IRBuilder change and de-constify types.

Modified:
    llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp

Modified: llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp?rev=135373&r1=135372&r2=135373&view=diff
==============================================================================
--- llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp (original)
+++ llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp Sun Jul 17 23:52:09 2011
@@ -209,7 +209,7 @@
 /// @param isVarArg function uses vararg arguments
 /// @returns function instance
 llvm::Function *createFunction(llvm::Module &module,
-                               const llvm::Type *retType,
+                               llvm::Type *retType,
                                const ArgTypes &theArgTypes,
                                const ArgNames &theArgNames,
                                const std::string &functName,
@@ -246,7 +246,7 @@
 /// @returns AllocaInst instance
 static llvm::AllocaInst *createEntryBlockAlloca(llvm::Function &function,
                                                 const std::string &varName,
-                                                const llvm::Type *type,
+                                                llvm::Type *type,
                                                 llvm::Constant *initWith = 0) {
   llvm::BasicBlock &block = function.getEntryBlock(); 
   llvm::IRBuilder<> tmp(&block, block.begin());
@@ -986,8 +986,7 @@
                          ourExceptionNotThrownState->getType(),
                          ourExceptionNotThrownState);
   
-  const llvm::PointerType *exceptionStorageType = 
-      builder.getInt8PtrTy();
+  llvm::PointerType *exceptionStorageType = builder.getInt8PtrTy();
   *exceptionStorage = 
   createEntryBlockAlloca(toAddTo,
                          "exceptionStorage",
@@ -1181,8 +1180,7 @@
   builder.CreateInvoke(&toInvoke, 
                        normalBlock, 
                        exceptionBlock, 
-                       args.begin(), 
-                       args.end());
+                       args);
   
   // End Block
   
@@ -1263,9 +1261,7 @@
   // handles this call. This landing pad (this exception block), will be 
   // called either because it nees to cleanup (call finally) or a type 
   // info was found which matched the thrown exception.
-  llvm::Value *retTypeInfoIndex = builder.CreateCall(ehSelector, 
-                                                     args.begin(), 
-                                                     args.end());
+  llvm::Value *retTypeInfoIndex = builder.CreateCall(ehSelector, args);
   
   // Retrieve exception_class member from thrown exception 
   // (_Unwind_Exception instance). This member tells us whether or not
@@ -1724,7 +1720,7 @@
   
   // print32Int
   
-  const llvm::Type *retType = builder.getVoidTy();
+  llvm::Type *retType = builder.getVoidTy();
   
   argTypes.clear();
   argTypes.push_back(builder.getInt32Ty());





More information about the llvm-commits mailing list