[llvm-branch-commits] [llvm-gcc-branch] r83025 - in /llvm-gcc-4.2/branches/eh-experiment/gcc: llvm-convert.cpp llvm-internal.h
Eric Christopher
echristo at apple.com
Mon Sep 28 15:28:53 PDT 2009
Author: echristo
Date: Mon Sep 28 17:28:53 2009
New Revision: 83025
URL: http://llvm.org/viewvc/llvm-project?rev=83025&view=rev
Log:
Use new intrinsic to mark eh regions.
Modified:
llvm-gcc-4.2/branches/eh-experiment/gcc/llvm-convert.cpp
llvm-gcc-4.2/branches/eh-experiment/gcc/llvm-internal.h
Modified: llvm-gcc-4.2/branches/eh-experiment/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/eh-experiment/gcc/llvm-convert.cpp?rev=83025&r1=83024&r2=83025&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/eh-experiment/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/branches/eh-experiment/gcc/llvm-convert.cpp Mon Sep 28 17:28:53 2009
@@ -177,6 +177,7 @@
ExceptionValue = 0;
ExceptionSelectorValue = 0;
+ FuncEHPersonality = 0;
FuncEHException = 0;
FuncEHSelector = 0;
FuncEHGetTypeID = 0;
@@ -1919,6 +1920,11 @@
ExceptionSelectorValue = CreateTemporary(IntPtr);
ExceptionSelectorValue->setName("eh_selector");
+ FuncEHPersonality = Intrinsic::getDeclaration(TheModule,
+ (IntPtr == Type::getInt32Ty(Context) ?
+ Intrinsic::eh_personality_i32 :
+ Intrinsic::eh_personality_i64));
+
FuncEHException = Intrinsic::getDeclaration(TheModule,
Intrinsic::eh_exception);
FuncEHSelector = Intrinsic::getDeclaration(TheModule,
@@ -1969,8 +1975,11 @@
Builder.CreateStore(Ex, ExceptionValue);
// Grab the type of the exception - eh selector for now...
- // Value *EHType = Builder.CreateCall(FuncEHSelector, "eh_select");
- //Builder.CreateStore(EHType, ExceptionSelectorValue);
+ Value *EHType = Builder.CreateCall(FuncEHPersonality,
+ BitCastToType(DECL_LLVM(llvm_eh_personality_libfunc),
+ PointerType::getUnqual(Type::getInt8Ty(Context))),
+ "eh_select");
+ Builder.CreateStore(EHType, ExceptionSelectorValue);
// Make sure the post pads exist
foreach_reachable_handler(i, false, AddHandler, &Handlers);
Modified: llvm-gcc-4.2/branches/eh-experiment/gcc/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/eh-experiment/gcc/llvm-internal.h?rev=83025&r1=83024&r2=83025&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/eh-experiment/gcc/llvm-internal.h (original)
+++ llvm-gcc-4.2/branches/eh-experiment/gcc/llvm-internal.h Mon Sep 28 17:28:53 2009
@@ -322,6 +322,9 @@
/// selector.
Value *ExceptionSelectorValue;
+ /// FuncEHPersonality - Function used to mark catch all blocks
+ Function *FuncEHPersonality;
+
/// FuncEHException - Function used to receive the exception.
Function *FuncEHException;
More information about the llvm-branch-commits
mailing list