From: Michael Kuperstein Date: Tue, 23 Dec 2014 08:23:45 +0000 (+0000) Subject: Remove a bad cast in CloneModule() X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fc86f5fc9f42458408d938df9928f53a1c27e0fd;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224756 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Utils/CloneModule.cpp b/lib/Transforms/Utils/CloneModule.cpp index d05d25164cd..fae9ff5bce0 100644 --- a/lib/Transforms/Utils/CloneModule.cpp +++ b/lib/Transforms/Utils/CloneModule.cpp @@ -109,7 +109,7 @@ Module *llvm::CloneModule(const Module *M, ValueToValueMapTy &VMap) { I != E; ++I) { GlobalAlias *GA = cast(VMap[I]); if (const Constant *C = I->getAliasee()) - GA->setAliasee(cast(MapValue(C, VMap))); + GA->setAliasee(MapValue(C, VMap)); } // And named metadata....