[llvm-commits] [llvm] r124404 - /llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp

Nick Lewycky nicholas at mxc.ca
Thu Jan 27 11:42:43 PST 2011


Author: nicholas
Date: Thu Jan 27 13:42:43 2011
New Revision: 124404

URL: http://llvm.org/viewvc/llvm-project?rev=124404&view=rev
Log:
Use dyn_cast instead of isa+cast.

Modified:
    llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp

Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=124404&r1=124403&r2=124404&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Thu Jan 27 13:42:43 2011
@@ -460,9 +460,8 @@
   if (V1 == F2 && V2 == F1)
     return true;
 
-  if (isa<Constant>(V1)) {
+  if (Constant *C1 = dyn_cast<Constant>(V1)) {
     if (V1 == V2) return true;
-    const Constant *C1 = cast<Constant>(V1);
     const Constant *C2 = dyn_cast<Constant>(V2);
     if (!C2) return false;
     // TODO: constant expressions with GEP or references to F1 or F2.





More information about the llvm-commits mailing list