On Apr 11, 2011, at 7:13 AM, Anders Carlsson wrote:
> Author: andersca
> Date: Mon Apr 11 09:13:40 2011
> New Revision: 129273
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=129273&view=rev
> Log:
> If there's an invoke destination, we should use invoke instead of call when 
> calling the __cxa_bad_typeid function. Fixes PR7400.

Nice catch!

> +static void EmitBadTypeidCall(CodeGenFunction &CGF) {
> +  llvm::Value *F = getBadTypeidFn(CGF);
> +  if (llvm::BasicBlock *InvokeDest = CGF.getInvokeDest()) {
> +    llvm::BasicBlock *Cont = CGF.createBasicBlock("invoke.cont");
> +    CGF.Builder.CreateInvoke(F, Cont, InvokeDest)->setDoesNotReturn();
> +    CGF.EmitBlock(Cont);
> +  } else
> +    CGF.Builder.CreateCall(F)->setDoesNotReturn();
> +  
> +  CGF.Builder.CreateUnreachable();
> +}
> +

CGF.EmitCallOrInvoke(...).setDoesNotReturn();
CGF.Builder.CreateUnreachable();

John.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to