From: Duncan Sands Date: Wed, 14 Oct 2009 16:13:30 +0000 (+0000) Subject: There is now only one version of eh.selector and eh.typeid.for. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=790b20ed2cec72b4a79d1829ffc2c0339acbdec3;p=clang There is now only one version of eh.selector and eh.typeid.for. Fix the clang build. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84107 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index c34138fbd2..f348bfffcb 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -1643,17 +1643,12 @@ void CGObjCGNU::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF, // Get the correct versions of the exception handling intrinsics llvm::TargetData td = llvm::TargetData::TargetData(&TheModule); - int PointerWidth = td.getTypeSizeInBits(PtrTy); - assert((PointerWidth == 32 || PointerWidth == 64) && - "Can't yet handle exceptions if pointers are not 32 or 64 bits"); llvm::Value *llvm_eh_exception = CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_exception); - llvm::Value *llvm_eh_selector = PointerWidth == 32 ? - CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_selector_i32) : - CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_selector_i64); - llvm::Value *llvm_eh_typeid_for = PointerWidth == 32 ? - CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_typeid_for_i32) : - CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_typeid_for_i64); + llvm::Value *llvm_eh_selector = + CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_selector); + llvm::Value *llvm_eh_typeid_for = + CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_typeid_for); // Exception object llvm::Value *Exc = CGF.Builder.CreateCall(llvm_eh_exception, "exc"); diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index af9e9b3527..4485ed5aee 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -5425,10 +5425,10 @@ CGObjCNonFragileABIMac::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF, llvm::Value *llvm_eh_exception = CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_exception); - llvm::Value *llvm_eh_selector_i64 = - CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_selector_i64); - llvm::Value *llvm_eh_typeid_for_i64 = - CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_typeid_for_i64); + llvm::Value *llvm_eh_selector = + CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_selector); + llvm::Value *llvm_eh_typeid_for = + CGF.CGM.getIntrinsic(llvm::Intrinsic::eh_typeid_for); llvm::Value *Exc = CGF.Builder.CreateCall(llvm_eh_exception, "exc"); llvm::Value *RethrowPtr = CGF.CreateTempAlloca(Exc->getType(), "_rethrow"); @@ -5490,7 +5490,7 @@ CGObjCNonFragileABIMac::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF, } llvm::Value *Selector = - CGF.Builder.CreateCall(llvm_eh_selector_i64, + CGF.Builder.CreateCall(llvm_eh_selector, SelectorArgs.begin(), SelectorArgs.end(), "selector"); for (unsigned i = 0, e = Handlers.size(); i != e; ++i) { @@ -5506,7 +5506,7 @@ CGObjCNonFragileABIMac::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF, llvm::BasicBlock *Match = CGF.createBasicBlock("match"); Next = CGF.createBasicBlock("catch.next"); llvm::Value *Id = - CGF.Builder.CreateCall(llvm_eh_typeid_for_i64, + CGF.Builder.CreateCall(llvm_eh_typeid_for, CGF.Builder.CreateBitCast(SelectorArgs[i+2], ObjCTypes.Int8PtrTy)); CGF.Builder.CreateCondBr(CGF.Builder.CreateICmpEQ(Selector, Id), @@ -5557,7 +5557,7 @@ CGObjCNonFragileABIMac::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF, Args.push_back(ObjCTypes.getEHPersonalityPtr()); Args.push_back(llvm::ConstantInt::get(llvm::Type::getInt32Ty(VMContext), 0)); - CGF.Builder.CreateCall(llvm_eh_selector_i64, Args.begin(), Args.end()); + CGF.Builder.CreateCall(llvm_eh_selector, Args.begin(), Args.end()); CGF.Builder.CreateStore(Exc, RethrowPtr); CGF.EmitBranchThroughCleanup(FinallyRethrow); @@ -5589,7 +5589,7 @@ CGObjCNonFragileABIMac::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF, Args.push_back(ObjCTypes.getEHPersonalityPtr()); Args.push_back(llvm::ConstantInt::get(llvm::Type::getInt32Ty(VMContext), 0)); - CGF.Builder.CreateCall(llvm_eh_selector_i64, Args.begin(), Args.end()); + CGF.Builder.CreateCall(llvm_eh_selector, Args.begin(), Args.end()); CGF.Builder.CreateStore(Exc, RethrowPtr); CGF.EmitBranchThroughCleanup(FinallyRethrow);