[llvm] r191712 - Reuse variable

Matt Arsenault Matthew.Arsenault at amd.com
Mon Sep 30 16:31:51 PDT 2013


Author: arsenm
Date: Mon Sep 30 18:31:50 2013
New Revision: 191712

URL: http://llvm.org/viewvc/llvm-project?rev=191712&view=rev
Log:
Reuse variable

Modified:
    llvm/trunk/lib/IR/Module.cpp

Modified: llvm/trunk/lib/IR/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Module.cpp?rev=191712&r1=191711&r2=191712&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Module.cpp (original)
+++ llvm/trunk/lib/IR/Module.cpp Mon Sep 30 18:31:50 2013
@@ -262,7 +262,7 @@ Constant *Module::getOrInsertGlobal(Stri
   // right type.
   Type *GVTy = GV->getType();
   PointerType *PTy = PointerType::get(Ty, GVTy->getPointerAddressSpace());
-  if (GV->getType() != PTy)
+  if (GVTy != PTy)
     return ConstantExpr::getBitCast(GV, PTy);
 
   // Otherwise, we just found the existing function or a prototype.





More information about the llvm-commits mailing list