[cfe-commits] r129424 - /cfe/trunk/lib/CodeGen/CGExprCXX.cpp

Anders Carlsson andersca at mac.com
Tue Apr 12 19:35:36 PDT 2011


Author: andersca
Date: Tue Apr 12 21:35:36 2011
New Revision: 129424

URL: http://llvm.org/viewvc/llvm-project?rev=129424&view=rev
Log:
Use EmitCallOrInvoke in EmitBadTypeidCall and EmitBadCastCall.

Modified:
    cfe/trunk/lib/CodeGen/CGExprCXX.cpp

Modified: cfe/trunk/lib/CodeGen/CGExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprCXX.cpp?rev=129424&r1=129423&r2=129424&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprCXX.cpp Tue Apr 12 21:35:36 2011
@@ -17,6 +17,8 @@
 #include "CGObjCRuntime.h"
 #include "CGDebugInfo.h"
 #include "llvm/Intrinsics.h"
+#include "llvm/Support/CallSite.h"
+
 using namespace clang;
 using namespace CodeGen;
 
@@ -1349,14 +1351,8 @@
 }
 
 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();
-  
+  llvm::Value *Fn = getBadTypeidFn(CGF);
+  CGF.EmitCallOrInvoke(Fn, 0, 0).setDoesNotReturn();
   CGF.Builder.CreateUnreachable();
 }
 
@@ -1437,14 +1433,8 @@
 }
 
 static void EmitBadCastCall(CodeGenFunction &CGF) {
-  llvm::Value *F = getBadCastFn(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();
-  
+  llvm::Value *Fn = getBadCastFn(CGF);
+  CGF.EmitCallOrInvoke(Fn, 0, 0).setDoesNotReturn();
   CGF.Builder.CreateUnreachable();
 }
 





More information about the cfe-commits mailing list