[cfe-commits] r89004 - /cfe/trunk/lib/CodeGen/CGCXXExpr.cpp

Mike Stump mrs at apple.com
Mon Nov 16 16:08:50 PST 2009


Author: mrs
Date: Mon Nov 16 18:08:50 2009
New Revision: 89004

URL: http://llvm.org/viewvc/llvm-project?rev=89004&view=rev
Log:
Minor CFG refinements for typeid and dynamic_cast.

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

Modified: cfe/trunk/lib/CodeGen/CGCXXExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXXExpr.cpp?rev=89004&r1=89003&r2=89004&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXXExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXXExpr.cpp Mon Nov 16 18:08:50 2009
@@ -389,7 +389,6 @@
         FTy = llvm::FunctionType::get(ResultType, false);
         llvm::Value *F = CGM.CreateRuntimeFunction(FTy, "__cxa_bad_typeid");
         Builder.CreateCall(F)->setDoesNotReturn();
-        // FIXME: Should we have the below?
         Builder.CreateUnreachable();
         EmitBlock(NonZeroBlock);
       }
@@ -501,7 +500,7 @@
       FTy = llvm::FunctionType::get(ResultType, false);
       llvm::Value *F = CGM.CreateRuntimeFunction(FBadTy, "__cxa_bad_cast");
       Builder.CreateCall(F)->setDoesNotReturn();
-      // Builder.CreateUnreachable();
+      Builder.CreateUnreachable();
     }
   }
   
@@ -516,8 +515,6 @@
     PHI->reserveOperandSpace(3);
     PHI->addIncoming(V, NonZeroBlock);
     PHI->addIncoming(llvm::Constant::getNullValue(LTy), NullBlock);
-    if (ThrowOnBad)
-      PHI->addIncoming(llvm::Constant::getNullValue(LTy), BadCastBlock);
     V = PHI;
   }
 





More information about the cfe-commits mailing list