[cfe-commits] r91001 - /cfe/trunk/lib/CodeGen/CGException.cpp

Mike Stump mrs at apple.com
Wed Dec 9 16:06:18 PST 2009


Author: mrs
Date: Wed Dec  9 18:06:18 2009
New Revision: 91001

URL: http://llvm.org/viewvc/llvm-project?rev=91001&view=rev
Log:
Fixup spacing.

Modified:
    cfe/trunk/lib/CodeGen/CGException.cpp

Modified: cfe/trunk/lib/CodeGen/CGException.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGException.cpp?rev=91001&r1=91000&r2=91001&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGException.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGException.cpp Wed Dec  9 18:06:18 2009
@@ -23,11 +23,11 @@
   // void *__cxa_allocate_exception(size_t thrown_size);
   const llvm::Type *SizeTy = CGF.ConvertType(CGF.getContext().getSizeType());
   std::vector<const llvm::Type*> Args(1, SizeTy);
-  
-  const llvm::FunctionType *FTy = 
+
+  const llvm::FunctionType *FTy =
   llvm::FunctionType::get(llvm::Type::getInt8PtrTy(CGF.getLLVMContext()),
                           Args, false);
-  
+
   return CGF.CGM.CreateRuntimeFunction(FTy, "__cxa_allocate_exception");
 }
 
@@ -35,34 +35,34 @@
   // void __cxa_free_exception(void *thrown_exception);
   const llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(CGF.getLLVMContext());
   std::vector<const llvm::Type*> Args(1, Int8PtrTy);
-  
-  const llvm::FunctionType *FTy = 
+
+  const llvm::FunctionType *FTy =
   llvm::FunctionType::get(llvm::Type::getVoidTy(CGF.getLLVMContext()),
                           Args, false);
-  
+
   return CGF.CGM.CreateRuntimeFunction(FTy, "__cxa_free_exception");
 }
 
 static llvm::Constant *getThrowFn(CodeGenFunction &CGF) {
-  // void __cxa_throw(void *thrown_exception, std::type_info *tinfo, 
+  // void __cxa_throw(void *thrown_exception, std::type_info *tinfo,
   //                  void (*dest) (void *));
 
   const llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(CGF.getLLVMContext());
   std::vector<const llvm::Type*> Args(3, Int8PtrTy);
-  
-  const llvm::FunctionType *FTy = 
+
+  const llvm::FunctionType *FTy =
     llvm::FunctionType::get(llvm::Type::getVoidTy(CGF.getLLVMContext()),
                             Args, false);
-  
+
   return CGF.CGM.CreateRuntimeFunction(FTy, "__cxa_throw");
 }
 
 static llvm::Constant *getReThrowFn(CodeGenFunction &CGF) {
   // void __cxa_rethrow();
 
-  const llvm::FunctionType *FTy = 
+  const llvm::FunctionType *FTy =
     llvm::FunctionType::get(llvm::Type::getVoidTy(CGF.getLLVMContext()), false);
-  
+
   return CGF.CGM.CreateRuntimeFunction(FTy, "__cxa_rethrow");
 }
 
@@ -71,19 +71,19 @@
 
   const llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(CGF.getLLVMContext());
   std::vector<const llvm::Type*> Args(1, Int8PtrTy);
-  
-  const llvm::FunctionType *FTy = 
+
+  const llvm::FunctionType *FTy =
     llvm::FunctionType::get(Int8PtrTy, Args, false);
-  
+
   return CGF.CGM.CreateRuntimeFunction(FTy, "__cxa_begin_catch");
 }
 
 static llvm::Constant *getEndCatchFn(CodeGenFunction &CGF) {
   // void __cxa_end_catch();
 
-  const llvm::FunctionType *FTy = 
+  const llvm::FunctionType *FTy =
     llvm::FunctionType::get(llvm::Type::getVoidTy(CGF.getLLVMContext()), false);
-  
+
   return CGF.CGM.CreateRuntimeFunction(FTy, "__cxa_end_catch");
 }
 
@@ -92,11 +92,11 @@
 
   const llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(CGF.getLLVMContext());
   std::vector<const llvm::Type*> Args(1, Int8PtrTy);
-  
-  const llvm::FunctionType *FTy = 
+
+  const llvm::FunctionType *FTy =
     llvm::FunctionType::get(llvm::Type::getVoidTy(CGF.getLLVMContext()),
                             Args, false);
-  
+
   return CGF.CGM.CreateRuntimeFunction(FTy, "__cxa_call_unexpected");
 }
 
@@ -107,11 +107,11 @@
 static llvm::Constant *getUnwindResumeOrRethrowFn(CodeGenFunction &CGF) {
   const llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(CGF.getLLVMContext());
   std::vector<const llvm::Type*> Args(1, Int8PtrTy);
-  
-  const llvm::FunctionType *FTy = 
+
+  const llvm::FunctionType *FTy =
     llvm::FunctionType::get(llvm::Type::getVoidTy(CGF.getLLVMContext()), Args,
                             false);
-  
+
   if (using_sjlj_exceptions)
     return CGF.CGM.CreateRuntimeFunction(FTy, "_Unwind_SjLj_Resume");
   return CGF.CGM.CreateRuntimeFunction(FTy, "_Unwind_Resume_or_Rethrow");
@@ -120,9 +120,9 @@
 static llvm::Constant *getTerminateFn(CodeGenFunction &CGF) {
   // void __terminate();
 
-  const llvm::FunctionType *FTy = 
+  const llvm::FunctionType *FTy =
     llvm::FunctionType::get(llvm::Type::getVoidTy(CGF.getLLVMContext()), false);
-  
+
   return CGF.CGM.CreateRuntimeFunction(FTy, "_ZSt9terminatev");
 }
 
@@ -135,7 +135,7 @@
   if (!CGF.hasAggregateLLVMType(ObjectType)) {
     llvm::Value *Value = CGF.EmitScalarExpr(E);
     const llvm::Type *ValuePtrTy = Value->getType()->getPointerTo(0);
-    
+
     CGF.Builder.CreateStore(Value, CGF.Builder.CreateBitCast(N, ValuePtrTy));
   } else {
     const llvm::Type *Ty = CGF.ConvertType(ObjectType)->getPointerTo(0);
@@ -245,40 +245,40 @@
     Builder.ClearInsertionPoint();
     return;
   }
-  
+
   QualType ThrowType = E->getSubExpr()->getType();
-  
+
   // Now allocate the exception object.
   const llvm::Type *SizeTy = ConvertType(getContext().getSizeType());
   uint64_t TypeSize = getContext().getTypeSize(ThrowType) / 8;
-  
+
   llvm::Constant *AllocExceptionFn = getAllocateExceptionFn(*this);
-  llvm::Value *ExceptionPtr = 
-    Builder.CreateCall(AllocExceptionFn, 
+  llvm::Value *ExceptionPtr =
+    Builder.CreateCall(AllocExceptionFn,
                        llvm::ConstantInt::get(SizeTy, TypeSize),
                        "exception");
 
   CopyObject(*this, E->getSubExpr(), ExceptionPtr);
-  
+
   // Now throw the exception.
   const llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(getLLVMContext());
   llvm::Constant *TypeInfo = CGM.GenerateRTTI(ThrowType);
   llvm::Constant *Dtor = llvm::Constant::getNullValue(Int8PtrTy);
-  
+
   if (getInvokeDest()) {
     llvm::BasicBlock *Cont = createBasicBlock("invoke.cont");
-    llvm::InvokeInst *ThrowCall = 
+    llvm::InvokeInst *ThrowCall =
       Builder.CreateInvoke3(getThrowFn(*this), Cont, getInvokeDest(),
                             ExceptionPtr, TypeInfo, Dtor);
     ThrowCall->setDoesNotReturn();
     EmitBlock(Cont);
   } else {
-    llvm::CallInst *ThrowCall = 
+    llvm::CallInst *ThrowCall =
       Builder.CreateCall3(getThrowFn(*this), ExceptionPtr, TypeInfo, Dtor);
     ThrowCall->setDoesNotReturn();
   }
   Builder.CreateUnreachable();
-  
+
   // Clear the insertion point to indicate we are in unreachable code.
   Builder.ClearInsertionPoint();
 
@@ -437,18 +437,18 @@
       PushCleanupBlock(DtorEpilogue);
 
       EmitStmt(S.getTryBlock());
-      
+
       CleanupBlockInfo Info = PopCleanupBlock();
 
       assert(Info.CleanupBlock == DtorEpilogue && "Block mismatch!");
       EmitBlock(DtorEpilogue);
       EmitDtorEpilogue(DD, GD.getDtorType());
-      
+
       if (Info.SwitchBlock)
         EmitBlock(Info.SwitchBlock);
       if (Info.EndBlock)
         EmitBlock(Info.EndBlock);
-    } else 
+    } else
       EmitStmt(S.getTryBlock());
   } else
     EmitStmt(S.getTryBlock());
@@ -460,7 +460,7 @@
 
   // Emit the handlers
   EmitBlock(TryHandler);
-  
+
   const llvm::IntegerType *Int8Ty;
   const llvm::PointerType *PtrToInt8Ty;
   Int8Ty = llvm::Type::getInt8Ty(VMContext);
@@ -716,7 +716,7 @@
   Args.push_back(llvm::ConstantInt::get(llvm::Type::getInt32Ty(VMContext),
                                         1));
   Builder.CreateCall(llvm_eh_selector, Args.begin(), Args.end());
-  llvm::CallInst *TerminateCall = 
+  llvm::CallInst *TerminateCall =
     Builder.CreateCall(getTerminateFn(*this));
   TerminateCall->setDoesNotReturn();
   TerminateCall->setDoesNotThrow();





More information about the cfe-commits mailing list