[llvm] r224756 - Remove a bad cast in CloneModule()

Michael Kuperstein michael.m.kuperstein at intel.com
Tue Dec 23 00:23:45 PST 2014


Author: mkuper
Date: Tue Dec 23 02:23:45 2014
New Revision: 224756

URL: http://llvm.org/viewvc/llvm-project?rev=224756&view=rev
Log:
Remove a bad cast in CloneModule()

A cast that was introduced in r209007 was accidentally left in after the changes made to GlobalAlias rules in r210062. This crashes if the aliasee is a now-leggal ConstantExpr.

Modified:
    llvm/trunk/lib/Transforms/Utils/CloneModule.cpp

Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneModule.cpp?rev=224756&r1=224755&r2=224756&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/CloneModule.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Tue Dec 23 02:23:45 2014
@@ -109,7 +109,7 @@ Module *llvm::CloneModule(const Module *
        I != E; ++I) {
     GlobalAlias *GA = cast<GlobalAlias>(VMap[I]);
     if (const Constant *C = I->getAliasee())
-      GA->setAliasee(cast<GlobalObject>(MapValue(C, VMap)));
+      GA->setAliasee(MapValue(C, VMap));
   }
 
   // And named metadata....





More information about the llvm-commits mailing list