From fc86f5fc9f42458408d938df9928f53a1c27e0fd Mon Sep 17 00:00:00 2001 From: Michael Kuperstein Date: Tue, 23 Dec 2014 08:23:45 +0000 Subject: [PATCH] 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 --- lib/Transforms/Utils/CloneModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.... -- 2.34.1