From ad333484ea5ae976b83e35ccd3f6cfa6e71290e2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 14 Aug 2002 18:24:09 +0000 Subject: Remove support for Not ConstantExpr. This simplifies the unary case to only have to support the cast instruction, so the function is renamed to getCast. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3328 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Linker/LinkModules.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Linker') diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 48e40d0..21e25b4 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -119,10 +119,10 @@ static Value *RemapOperand(const Value *In, map &LocalMap, Result = ConstantPointerRef::get(cast(V)); } else if (const ConstantExpr *CE = dyn_cast(CPV)) { if (CE->getNumOperands() == 1) { - // Cast instruction, unary operator + // Cast instruction + assert(CE->getOpcode() == Instruction::Cast); Value *V = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap); - Result = ConstantExpr::get(CE->getOpcode(), cast(V), - CE->getType()); + Result = ConstantExpr::getCast(cast(V), CE->getType()); } else if (CE->getNumOperands() == 2) { // Binary operator... Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap); -- cgit v1.1