[llvm-commits] [llvm-gcc-4.2] r43187 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-internal.h
Duncan Sands
baldrick at free.fr
Fri Oct 19 13:03:03 PDT 2007
Author: baldrick
Date: Fri Oct 19 15:03:02 2007
New Revision: 43187
URL: http://llvm.org/viewvc/llvm-project?rev=43187&view=rev
Log:
Only declare the exception handling personality and
unwind resume functions if they are actually used.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
llvm-gcc-4.2/trunk/gcc/llvm-internal.h
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=43187&r1=43186&r2=43187&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Fri Oct 19 15:03:02 2007
@@ -369,8 +369,6 @@
FuncEHException = 0;
FuncEHSelector = 0;
FuncEHGetTypeID = 0;
- FuncEHPersonality = 0;
- FuncUnwindResume = 0;
NumAddressTakenBlocks = 0;
IndirectGotoBlock = 0;
@@ -1793,14 +1791,6 @@
(IntPtr == Type::Int32Ty ?
Intrinsic::eh_typeid_for_i32 :
Intrinsic::eh_typeid_for_i64));
-
- assert(llvm_eh_personality_libfunc
- && "no exception handling personality function!");
- FuncEHPersonality = DECL_LLVM(llvm_eh_personality_libfunc);
-
- assert(llvm_unwind_resume_libfunc
- && "no unwind resume function!");
- FuncUnwindResume = DECL_LLVM(llvm_unwind_resume_libfunc);
}
/// getPostPad - Return the post landing pad for the given exception handling
@@ -1844,7 +1834,10 @@
// The exception and the personality function.
Args.push_back(Builder.CreateLoad(ExceptionValue, "eh_ptr"));
- Args.push_back(CastToType(Instruction::BitCast, FuncEHPersonality,
+ assert(llvm_eh_personality_libfunc
+ && "no exception handling personality function!");
+ Args.push_back(CastToType(Instruction::BitCast,
+ DECL_LLVM(llvm_eh_personality_libfunc),
PointerType::get(Type::Int8Ty)));
// Add selections for each handler.
@@ -2041,7 +2034,8 @@
EmitBlock(UnwindBB);
// Fetch and store exception handler.
Value *Arg = Builder.CreateLoad(ExceptionValue, "eh_ptr");
- Builder.CreateCall(FuncUnwindResume, Arg);
+ assert(llvm_unwind_resume_libfunc && "no unwind resume function!");
+ Builder.CreateCall(DECL_LLVM(llvm_unwind_resume_libfunc), Arg);
Builder.CreateUnreachable();
}
}
Modified: llvm-gcc-4.2/trunk/gcc/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-internal.h?rev=43187&r1=43186&r2=43187&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-internal.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-internal.h Fri Oct 19 15:03:02 2007
@@ -284,12 +284,6 @@
/// FuncEHGetTypeID - Function used to return type id for give typeinfo.
Function *FuncEHGetTypeID;
- /// FuncEHPersonality - Function providing the exception handling personality.
- Value *FuncEHPersonality;
-
- /// FuncUnwindResume - Function used to continue exception unwinding.
- Value *FuncUnwindResume;
-
/// NumAddressTakenBlocks - Count the number of labels whose addresses are
/// taken.
uint64_t NumAddressTakenBlocks;
More information about the llvm-commits
mailing list