}
llvm::BasicBlock *CodeGenFunction::getTerminateHandler() {
+ if (TerminateHandler)
+ return TerminateHandler;
+
llvm::BasicBlock *Cont = 0;
if (HaveInsertPoint()) {
CGM.getIntrinsic(llvm::Intrinsic::eh_selector);
// Set up terminate handler
- llvm::BasicBlock *TerminateHandler = createBasicBlock("terminate.handler");
+ TerminateHandler = createBasicBlock("terminate.handler");
EmitBlock(TerminateHandler);
llvm::Value *Exc = Builder.CreateCall(llvm_eh_exception, "exc");
// We are required to emit this call to satisfy LLVM, even
DebugInfo(0), IndirectBranch(0),
SwitchInsn(0), CaseRangeBlock(0), InvokeDest(0),
CXXThisDecl(0), CXXVTTDecl(0),
- ConditionalBranchLevel(0) {
+ ConditionalBranchLevel(0), TerminateHandler(0) {
LLVMIntTy = ConvertType(getContext().IntTy);
LLVMPointerWidth = Target.getPointerWidth(0);
Exceptions = getContext().getLangOptions().Exceptions;
/// getByrefValueFieldNumber - Given a declaration, returns the LLVM field
/// number that holds the value.
unsigned getByRefValueLLVMField(const ValueDecl *VD) const;
+
+ llvm::BasicBlock *TerminateHandler;
public:
CodeGenFunction(CodeGenModule &cgm);
/// EmitEndEHSpec - Emit the end of the exception spec.
void EmitEndEHSpec(const Decl *D);
+ /// getTerminateHandler - Return a handler that just calls terminate.
llvm::BasicBlock *getTerminateHandler();
const llvm::Type *ConvertTypeForMem(QualType T);