[llvm-commits] [127793] Improve EH generation, patch by Duncan!

clattner at apple.com clattner at apple.com
Tue May 29 09:02:55 PDT 2007


Revision: 127793
Author:   clattner
Date:     2007-05-29 09:02:55 -0700 (Tue, 29 May 2007)

Log Message:
-----------
Improve EH generation, patch by Duncan!

Modified Paths:
--------------
    apple-local/branches/llvm/gcc/llvm-convert.cpp

Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp
===================================================================
--- apple-local/branches/llvm/gcc/llvm-convert.cpp	2007-05-29 09:03:03 UTC (rev 127792)
+++ apple-local/branches/llvm/gcc/llvm-convert.cpp	2007-05-29 16:02:55 UTC (rev 127793)
@@ -1940,7 +1940,13 @@
       break;
     }
   }
-  
+
+  CreateExceptionValues();
+
+  // Fetch and store the exception.
+  Value *Ex = Builder.CreateCall(FuncEHException, "eh_ptr");
+  Builder.CreateStore(Ex, ExceptionValue);
+
   if (!TryCatch) return;
   
   // Gather the typeinfo.
@@ -1948,8 +1954,6 @@
   tree Catches = TREE_OPERAND(TryCatch, 1);
   GatherTypeInfo(Catches, TypeInfos);
   
-  CreateExceptionValues();
-  
   // Choose type of landing pad type.
   Function *F = FuncEHSelector;
   
@@ -1959,10 +1963,6 @@
     F = FuncEHFilter;
   }
   
-  // Fetch and store the exception.
-  Value *Ex = Builder.CreateCall(FuncEHException, "eh_ptr");
-  Builder.CreateStore(Ex, ExceptionValue);
-        
   // Fetch and store exception handler.
   std::vector<Value*> Args;
   Args.push_back(Builder.CreateLoad(ExceptionValue, "eh_ptr"));





More information about the llvm-commits mailing list